├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── header.png
│ │ │ │ ├── nav_back.png
│ │ │ │ ├── pull_back.png
│ │ │ │ ├── pull_rider.png
│ │ │ │ ├── pull_sun.png
│ │ │ │ ├── pull_wheel.png
│ │ │ │ ├── ic_back_btn.png
│ │ │ │ ├── ic_baseadapter.png
│ │ │ │ ├── icon_collection.png
│ │ │ │ ├── tab_home_select.png
│ │ │ │ ├── tab_home_unselect.png
│ │ │ │ ├── ic_bttom_loading_01.png
│ │ │ │ ├── ic_bttom_loading_02.png
│ │ │ │ ├── icon_network_header.png
│ │ │ │ ├── ic_discover_white_24dp.png
│ │ │ │ └── ic_message_white_24dp.png
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── 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
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ ├── anim
│ │ │ │ ├── slide_bottom_out.xml
│ │ │ │ ├── slide_bottom_in.xml
│ │ │ │ ├── scale_tip_in.xml
│ │ │ │ ├── scale_tip_out.xml
│ │ │ │ ├── back_animation_one.xml
│ │ │ │ ├── back_animation_two.xml
│ │ │ │ ├── sun_animation.xml
│ │ │ │ └── wheel_animation.xml
│ │ │ ├── layout
│ │ │ │ ├── layout_base.xml
│ │ │ │ ├── activity_use_fragment.xml
│ │ │ │ ├── layout_state.xml
│ │ │ │ ├── layout_test.xml
│ │ │ │ ├── layout_main_header.xml
│ │ │ │ ├── layout_base_adapter_header.xml
│ │ │ │ ├── layout_network_header.xml
│ │ │ │ ├── item_popup.xml
│ │ │ │ ├── activity_tagview.xml
│ │ │ │ ├── activity_complex_drag.xml
│ │ │ │ ├── fragment_t.xml
│ │ │ │ ├── activity_permission.xml
│ │ │ │ ├── fragment_child.xml
│ │ │ │ ├── activity_color_statusbar.xml
│ │ │ │ ├── layout_recyclerview.xml
│ │ │ │ ├── fragment_nomore_auto.xml
│ │ │ │ ├── fragment_addheader_empty.xml
│ │ │ │ ├── fragment_transparent_blackfont_statusbar.xml
│ │ │ │ ├── fragment_default_refresh.xml
│ │ │ │ ├── activity_pull_refresh.xml
│ │ │ │ ├── activity_state_view.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── item_img.xml
│ │ │ │ ├── activity_wechat_featured.xml
│ │ │ │ ├── popup_menu_list.xml
│ │ │ │ ├── fragment_wechat_news.xml
│ │ │ │ ├── item_layout.xml
│ │ │ │ ├── activity_popup_list.xml
│ │ │ │ ├── fragment_root.xml
│ │ │ │ ├── dialog_list.xml
│ │ │ │ ├── fragment_google_refresh.xml
│ │ │ │ ├── activity_custom_tablayout_one.xml
│ │ │ │ ├── activity_custom_tablayout_seven.xml
│ │ │ │ ├── fragment_wechat_news1.xml
│ │ │ │ ├── activity_data_manager.xml
│ │ │ │ ├── activity_custom_tablayout_two.xml
│ │ │ │ ├── custom_tab_view.xml
│ │ │ │ ├── activity_transparent_statusbar.xml
│ │ │ │ ├── item_main.xml
│ │ │ │ ├── activity_custom_outsideframetablayout_one.xml
│ │ │ │ ├── popup_tip.xml
│ │ │ │ ├── layout_transprent_statusbar_header.xml
│ │ │ │ ├── activity_custom_tablayout_three.xml
│ │ │ │ ├── activity_refresh.xml
│ │ │ │ ├── activity_wrap_linear.xml
│ │ │ │ ├── activity_custom_tablayout_four.xml
│ │ │ │ ├── activity_custom_tablayout_six.xml
│ │ │ │ ├── layout_empty.xml
│ │ │ │ ├── activity_custom_tablayout_five.xml
│ │ │ │ ├── item_pull_refresh.xml
│ │ │ │ ├── activity_downlaod.xml
│ │ │ │ ├── fragment_sharepreference.xml
│ │ │ │ ├── activity_custom_outsideframetablayout_two.xml
│ │ │ │ ├── popup_slide_bottom.xml
│ │ │ │ ├── activity_popupwindow.xml
│ │ │ │ ├── popup_slide_button.xml
│ │ │ │ ├── activity_change_statusbar.xml
│ │ │ │ ├── layout_definition_animation_loading_more.xml
│ │ │ │ └── item_click.xml
│ │ │ └── drawable
│ │ │ │ ├── shape_item_click.xml
│ │ │ │ ├── selector_tab_home.xml
│ │ │ │ ├── selector_complex_item.xml
│ │ │ │ └── loading_bottom.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── youngmanster
│ │ │ └── collection
│ │ │ ├── mvp
│ │ │ ├── view
│ │ │ │ ├── IDownloadFileView.java
│ │ │ │ ├── IWeChatFeaturedView.java
│ │ │ │ ├── IWeChatWorldNewsView.java
│ │ │ │ ├── IWeChatChinaNewsDefinitionView.java
│ │ │ │ ├── IWeChatFeaturedNoCommonClassView.java
│ │ │ │ └── IWeChatWorldNewsDefinitionView.java
│ │ │ ├── presenter
│ │ │ │ ├── WeChatFeaturedNoCommonClassPresenter.java
│ │ │ │ ├── WeChatFeaturedPresenter.java
│ │ │ │ └── WeChatWorldNewsPresenter.java
│ │ │ └── ui
│ │ │ │ └── wechat
│ │ │ │ └── adapter
│ │ │ │ └── WeChatFeaturedAdapter.java
│ │ │ ├── http
│ │ │ └── ApiUrl.java
│ │ │ ├── common
│ │ │ └── AppConfig.java
│ │ │ ├── been
│ │ │ ├── ClickItem.java
│ │ │ ├── Result.java
│ │ │ ├── WeChatNewsResult.java
│ │ │ ├── MultiItem.java
│ │ │ └── User.java
│ │ │ ├── customview
│ │ │ ├── activity
│ │ │ │ ├── WrapLinearLayoutActivity.java
│ │ │ │ └── TagViewActivity.java
│ │ │ └── fragment
│ │ │ │ └── ChildFragment.java
│ │ │ ├── activity
│ │ │ └── base
│ │ │ │ ├── popupwindow
│ │ │ │ ├── PopupSlideBottom.java
│ │ │ │ ├── PopupTip.java
│ │ │ │ ├── PopupSlideButton.java
│ │ │ │ ├── PopupMenuList.java
│ │ │ │ └── PopupWindowDemoActivity.java
│ │ │ │ ├── adapter
│ │ │ │ ├── PopupMenuListAdapter.java
│ │ │ │ └── ItemRecycleAdapter.java
│ │ │ │ ├── activity
│ │ │ │ ├── UseFragmentActivity.java
│ │ │ │ ├── PopupMenuActivity.java
│ │ │ │ ├── ChangeStatusBarActivity.java
│ │ │ │ └── TransparentStatusBarActivity.java
│ │ │ │ └── fragment
│ │ │ │ ├── FragmentT.java
│ │ │ │ └── FragmentRoot.java
│ │ │ ├── adapter
│ │ │ ├── baseadapter
│ │ │ │ ├── DragAndDeleteAdapter.java
│ │ │ │ └── ItemClickAdapter.java
│ │ │ ├── recyclerview
│ │ │ │ ├── DefinitionRecyclerAdapter.java
│ │ │ │ ├── PullToRecyclerViewAdapter.java
│ │ │ │ ├── GoogleRefreshAdapter.java
│ │ │ │ └── DefaultRecyclerAdapter.java
│ │ │ ├── CollectionFragmentAdapter.java
│ │ │ └── MainViewAdapter.java
│ │ │ ├── data
│ │ │ └── fragment
│ │ │ │ └── FragmentSharePreference.java
│ │ │ └── base
│ │ │ └── BaseActivity.java
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── youngmanster
│ │ │ └── collection
│ │ │ ├── ExampleUnitTest.java
│ │ │ └── activity
│ │ │ └── MainActivityTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── youngmanster
│ │ └── collection
│ │ └── ExampleInstrumentedTest.java
├── local.properties
├── config.gradle
├── proguard-rules.pro
└── jacoco.gradle
├── collectionlibrary
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── anim
│ │ │ │ ├── no_anim.xml
│ │ │ │ ├── alpha_out.xml
│ │ │ │ ├── alpha_in.xml
│ │ │ │ ├── push_right_out.xml
│ │ │ │ ├── push_left_in.xml
│ │ │ │ ├── slide_left_in.xml
│ │ │ │ ├── slide_left_out.xml
│ │ │ │ ├── slide_right_in.xml
│ │ │ │ └── slide_right_out.xml
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── icon_disconnect.png
│ │ │ │ ├── fragmentation_help.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ ├── icon_refresh_arrow.png
│ │ │ │ ├── ic_bttom_loading_01.png
│ │ │ │ ├── fragmentation_ic_right.png
│ │ │ │ ├── fragmentation_ic_stack.png
│ │ │ │ └── fragmentation_ic_expandable.png
│ │ │ ├── xml
│ │ │ │ └── network_security_config.xml
│ │ │ ├── values
│ │ │ │ ├── ids.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── styles.xml
│ │ │ │ └── strings.xml
│ │ │ ├── drawable
│ │ │ │ ├── collection_library_shape_tagview_slector.xml
│ │ │ │ ├── collection_library_shape_tagview.xml
│ │ │ │ ├── collection_library_selector_tagview.xml
│ │ │ │ └── lift_on_touch.xml
│ │ │ ├── drawable-v21
│ │ │ │ └── ripple_bg.xml
│ │ │ ├── layout
│ │ │ │ ├── collection_library_design_layout_tab_icon.xml
│ │ │ │ ├── collection_library_design_layout_tab_text.xml
│ │ │ │ ├── collection_library_default_base_activity.xml
│ │ │ │ ├── collection_library_default_base_fragment.xml
│ │ │ │ ├── collection_library_dialog_title_text_two_button.xml
│ │ │ │ ├── collection_library_view_empty.xml
│ │ │ │ ├── collection_library_view_disconnect.xml
│ │ │ │ ├── collection_library_dialog_progress.xml
│ │ │ │ ├── collection_library_view_loading.xml
│ │ │ │ └── collection_library_layout_default_loading_more.xml
│ │ │ ├── values-zh-rTW
│ │ │ │ └── strings.xml
│ │ │ └── values-en
│ │ │ │ └── strings.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── youngmanster
│ │ │ │ └── collectionlibrary
│ │ │ │ ├── customview
│ │ │ │ ├── tablayout
│ │ │ │ │ └── OnTabSelectListener.java
│ │ │ │ ├── tagview
│ │ │ │ │ └── layout
│ │ │ │ │ │ ├── FlexWrap.java
│ │ │ │ │ │ ├── AlignItems.java
│ │ │ │ │ │ ├── AlignSelf.java
│ │ │ │ │ │ ├── FlexDirection.java
│ │ │ │ │ │ ├── AlignContent.java
│ │ │ │ │ │ └── JustifyContent.java
│ │ │ │ └── CollectionViewPager.java
│ │ │ │ ├── mvp
│ │ │ │ ├── BaseView.java
│ │ │ │ ├── BasePresenter.java
│ │ │ │ └── ClassGetUtil.java
│ │ │ │ ├── refreshrecyclerview
│ │ │ │ └── base
│ │ │ │ │ ├── adapter
│ │ │ │ │ └── BaseMultiItemEntity.java
│ │ │ │ │ └── refreshview
│ │ │ │ │ └── BaseLoadMoreView.java
│ │ │ │ ├── network
│ │ │ │ ├── rx
│ │ │ │ │ ├── utils
│ │ │ │ │ │ ├── SchedulerType.java
│ │ │ │ │ │ ├── IRxUITask.java
│ │ │ │ │ │ ├── IRxIOTask.java
│ │ │ │ │ │ ├── IExceptionHandler.java
│ │ │ │ │ │ ├── SimpleThrowableAction.java
│ │ │ │ │ │ ├── RxUITask.java
│ │ │ │ │ │ ├── RxIOTask.java
│ │ │ │ │ │ ├── RxTaskOnSubscribe.java
│ │ │ │ │ │ ├── RxAsyncTask.java
│ │ │ │ │ │ └── RxExceptionHandler.java
│ │ │ │ │ ├── ObservableListener.java
│ │ │ │ │ ├── RxObservableListener.java
│ │ │ │ │ ├── RxManager.java
│ │ │ │ │ ├── RxSchedulers.java
│ │ │ │ │ └── RxSubscriber.java
│ │ │ │ ├── convert
│ │ │ │ │ ├── ParameterizedTypeImpl.java
│ │ │ │ │ └── SetterExclusionStrategy.java
│ │ │ │ ├── RequestManager.java
│ │ │ │ └── download
│ │ │ │ │ └── DownloadInfo.java
│ │ │ │ ├── data
│ │ │ │ └── database
│ │ │ │ │ ├── Column.java
│ │ │ │ │ ├── PagingList.java
│ │ │ │ │ ├── DBTransaction.java
│ │ │ │ │ ├── DateUtils.java
│ │ │ │ │ ├── SQLiteVersionMigrate.java
│ │ │ │ │ └── ColumnInfo.java
│ │ │ │ ├── utils
│ │ │ │ ├── ColorUtils.java
│ │ │ │ ├── SoftInputUtils.java
│ │ │ │ └── GetPermissionsUtils.java
│ │ │ │ ├── base
│ │ │ │ └── activity
│ │ │ │ │ └── ResultCode.java
│ │ │ │ └── config
│ │ │ │ └── Config.java
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── youngmanster
│ │ │ └── collectionlibrary
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── youngmanster
│ │ └── collectionlibrary
│ │ └── ExampleInstrumentedTest.java
└── config.gradle
├── settings.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .idea
├── caches
│ └── build_file_checksums.ser
├── vcs.xml
├── encodings.xml
├── inspectionProfiles
│ └── Project_Default.xml
├── runConfigurations.xml
├── gradle.xml
└── modules.xml
├── .gitignore
├── gradle.properties
└── LICENSE
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/collectionlibrary/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':collectionlibrary'
2 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/.idea/caches/build_file_checksums.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/.idea/caches/build_file_checksums.ser
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xhdpi/header.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/nav_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xhdpi/nav_back.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/pull_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xhdpi/pull_back.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/pull_rider.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xhdpi/pull_rider.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/pull_sun.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xhdpi/pull_sun.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/pull_wheel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xhdpi/pull_wheel.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_back_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_back_btn.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_baseadapter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_baseadapter.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/icon_collection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xhdpi/icon_collection.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/tab_home_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xhdpi/tab_home_select.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/tab_home_unselect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xhdpi/tab_home_unselect.png
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 20sp
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_bttom_loading_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_bttom_loading_01.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_bttom_loading_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_bttom_loading_02.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/icon_network_header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xhdpi/icon_network_header.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_discover_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_discover_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_message_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_message_white_24dp.png
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/anim/no_anim.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/mipmap-xhdpi/icon_disconnect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/collectionlibrary/src/main/res/mipmap-xhdpi/icon_disconnect.png
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/mipmap-xhdpi/fragmentation_help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/collectionlibrary/src/main/res/mipmap-xhdpi/fragmentation_help.png
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/collectionlibrary/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/mipmap-xhdpi/icon_refresh_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/collectionlibrary/src/main/res/mipmap-xhdpi/icon_refresh_arrow.png
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/mipmap-xhdpi/ic_bttom_loading_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/collectionlibrary/src/main/res/mipmap-xhdpi/ic_bttom_loading_01.png
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/mipmap-xhdpi/fragmentation_ic_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/collectionlibrary/src/main/res/mipmap-xhdpi/fragmentation_ic_right.png
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/mipmap-xhdpi/fragmentation_ic_stack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/collectionlibrary/src/main/res/mipmap-xhdpi/fragmentation_ic_stack.png
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/mipmap-xhdpi/fragmentation_ic_expandable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android/HEAD/collectionlibrary/src/main/res/mipmap-xhdpi/fragmentation_ic_expandable.png
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_bottom_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_base.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/customview/tablayout/OnTabSelectListener.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.customview.tablayout;
2 |
3 | public interface OnTabSelectListener {
4 | void onTabSelect(int position);
5 | }
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_bottom_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/anim/alpha_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_item_click.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/mvp/BaseView.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.mvp;
2 |
3 | /**
4 | * Created by yangyan
5 | * on 2018/3/17.
6 | */
7 |
8 | public interface BaseView {
9 | void onError(String errorMsg);
10 | }
11 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/anim/alpha_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/mvp/view/IDownloadFileView.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.mvp.view;
2 |
3 | import com.youngmanster.collectionlibrary.mvp.BaseView;
4 |
5 | public interface IDownloadFileView extends BaseView{
6 | void updateProgress(float progress);
7 | }
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/anim/push_right_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/drawable/collection_library_shape_tagview_slector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_use_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/drawable-v21/ripple_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/drawable/collection_library_shape_tagview.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/layout/collection_library_design_layout_tab_icon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_tab_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_complex_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/http/ApiUrl.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.http;
2 |
3 | /**
4 | * Created by yangyan
5 | * on 2018/3/21.
6 | */
7 |
8 | public class ApiUrl {
9 |
10 | /**
11 | * 微信精选
12 | */
13 | public static final String URL_WETCHAT_FEATURED="getJoke";
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/scale_tip_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/scale_tip_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/refreshrecyclerview/base/adapter/BaseMultiItemEntity.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter;
2 |
3 | /**
4 | * 多布局需要实现这个类,通过该类来设置多布局的type
5 | * Created by yangyan
6 | * on 2018/3/14.
7 | */
8 |
9 | public interface BaseMultiItemEntity {
10 | int getItemViewType();
11 | }
12 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/drawable/collection_library_selector_tagview.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #66ccf5
4 | #ffffff
5 | #000000
6 |
7 | #3F51B5
8 | #3F51B5
9 | #FF4081
10 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/mvp/view/IWeChatFeaturedView.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.mvp.view;
2 |
3 | import com.youngmanster.collection.been.wechat.WeChatNews;
4 | import com.youngmanster.collectionlibrary.mvp.BaseView;
5 |
6 | import java.util.List;
7 |
8 | public interface IWeChatFeaturedView extends BaseView{
9 | void refreshUI(List newsList);
10 | }
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/layout/collection_library_design_layout_tab_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/mvp/view/IWeChatWorldNewsView.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.mvp.view;
2 |
3 | import com.youngmanster.collection.been.wechat.WeChatNews;
4 | import com.youngmanster.collectionlibrary.mvp.BaseView;
5 |
6 | import java.util.List;
7 |
8 | public interface IWeChatWorldNewsView extends BaseView{
9 | void refreshUI(List weChatNews);
10 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/loading_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/mvp/view/IWeChatChinaNewsDefinitionView.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.mvp.view;
2 |
3 | import com.youngmanster.collection.been.wechat.WeChatNews;
4 | import com.youngmanster.collectionlibrary.mvp.BaseView;
5 |
6 | import java.util.List;
7 |
8 | public interface IWeChatChinaNewsDefinitionView extends BaseView{
9 | void refreshUI(List weChatNews);
10 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/mvp/view/IWeChatFeaturedNoCommonClassView.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.mvp.view;
2 |
3 | import com.youngmanster.collection.been.wechat.WeChatNews;
4 | import com.youngmanster.collectionlibrary.mvp.BaseView;
5 |
6 | import java.util.List;
7 |
8 | public interface IWeChatFeaturedNoCommonClassView extends BaseView{
9 | void refreshUI(List newsList);
10 | }
--------------------------------------------------------------------------------
/app/src/main/res/anim/back_animation_one.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/back_animation_two.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/local.properties:
--------------------------------------------------------------------------------
1 | ## This file must *NOT* be checked into Version Control Systems,
2 | # as it contains information specific to your local configuration.
3 | #
4 | # Location of the SDK. This is only used by Gradle.
5 | # For customization when using a Version Control System, please read the
6 | # header note.
7 | #Tue Aug 27 16:27:31 CST 2019
8 | ndk.dir=E\:\\Android\\androidSdk\\ndk-bundle
9 | sdk.dir=E\:\\Android\\androidSdk
10 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/mvp/view/IWeChatWorldNewsDefinitionView.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.mvp.view;
2 |
3 | import com.youngmanster.collection.been.wechat.WeChatNews;
4 | import com.youngmanster.collectionlibrary.mvp.BaseView;
5 |
6 | import java.util.List;
7 |
8 | public interface IWeChatWorldNewsDefinitionView extends BaseView{
9 | void refreshUI(List weChatNews);
10 |
11 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_state.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/anim/push_left_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/sun_animation.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/wheel_animation.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/anim/slide_left_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/anim/slide_left_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/anim/slide_right_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/anim/slide_right_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/common/AppConfig.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.common;
2 |
3 | import android.os.Environment;
4 |
5 | /**
6 | * Created by yangyan
7 | * on 2018/3/25.
8 | */
9 |
10 | public class AppConfig {
11 | public final static String STORAGE_DIR= Environment.getExternalStorageDirectory().getAbsolutePath()+"/Collection/";
12 | public final static String URL_CACHE=STORAGE_DIR+"url/cache/";
13 | }
14 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #3F51B5
5 | #FF4081
6 | #ffffff
7 | #eeeeee
8 | #eeeeee
9 | #8f000000
10 | #FF000000
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_test.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_main_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_base_adapter_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_network_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_popup.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_tagview.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/youngmanster/collection/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/collectionlibrary/src/test/java/com/youngmanster/collectionlibrary/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_complex_drag.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/rx/utils/SchedulerType.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.network.rx.utils;
2 |
3 | /**
4 | * 线程类型
5 | */
6 | public enum SchedulerType {
7 |
8 | /**
9 | * 订阅发生在主线程 ( -> -> main)
10 | */
11 | _main,
12 | /**
13 | * 订阅发生在io线程 ( -> -> io)
14 | */
15 | _io,
16 | /**
17 | * 处理在io线程,订阅发生在主线程( -> io -> main)
18 | */
19 | _io_main,
20 | /**
21 | * 处理在io线程,订阅也发生在io线程( -> io -> io)
22 | */
23 | _io_io,
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/been/ClickItem.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.been;
2 |
3 | /**
4 | * Created by yangyan
5 | * on 2018/3/20.
6 | */
7 |
8 | public class ClickItem {
9 | private String title;
10 | private int res;
11 |
12 | public String getTitle() {
13 | return title;
14 | }
15 |
16 | public void setTitle(String title) {
17 | this.title = title;
18 | }
19 |
20 | public int getRes() {
21 | return res;
22 | }
23 |
24 | public void setRes(int res) {
25 | this.res = res;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_t.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
13 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/rx/ObservableListener.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.network.rx;
2 |
3 | import com.youngmanster.collectionlibrary.network.NetWorkCodeException;
4 |
5 | /**
6 | * Created by yangyan
7 | * on 2018/3/28.
8 | */
9 |
10 | public interface ObservableListener {
11 | void onNext(T result);
12 | void onError(NetWorkCodeException.ResponseThrowable e);
13 | void onDownloadProgress(long total,long currentLength,float progress);
14 | void onUploadProgress(long total,float progress);
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_permission.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_child.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
16 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/mvp/BasePresenter.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.mvp;
2 |
3 | import com.youngmanster.collectionlibrary.network.rx.RxManager;
4 | /**
5 | * Created by yangyan
6 | * on 2018/3/18.
7 | */
8 |
9 | public abstract class BasePresenter {
10 | public T mView;
11 |
12 | public RxManager rxManager=new RxManager();
13 |
14 | public void setV(T v){
15 | this.mView=v;
16 | }
17 |
18 | public void onDestroy(){
19 | this.mView=null;
20 | rxManager.clear();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_color_statusbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_recyclerview.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_nomore_auto.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_addheader_empty.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_transparent_blackfont_statusbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/data/database/Column.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.data.database;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * Created by yangy
10 | * 2020-02-24
11 | * Describe:
12 | */
13 | @Retention(RetentionPolicy.RUNTIME)
14 | @Target(ElementType.FIELD)
15 | public @interface Column {
16 | boolean isPrimaryKey()default false;
17 | boolean isNull()default true;
18 | boolean isUnique()default false;
19 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_default_refresh.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_pull_refresh.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_state_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_img.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_wechat_featured.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/customview/activity/WrapLinearLayoutActivity.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.customview.activity;
2 |
3 | import com.youngmanster.collection.R;
4 | import com.youngmanster.collection.base.BaseActivity;
5 |
6 | /**
7 | * @author yangyan
8 | * @Date on 2019/8/27
9 | * @ Description:
10 | */
11 | public class WrapLinearLayoutActivity extends BaseActivity {
12 | @Override
13 | public int getLayoutId() {
14 | return R.layout.activity_wrap_linear;
15 | }
16 |
17 | @Override
18 | public void init() {
19 | defineActionBarConfig.setTitle("AutoLineLayout");
20 | }
21 |
22 | @Override
23 | public void requestData() {
24 |
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/data/database/PagingList.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.data.database;
2 |
3 | import java.util.ArrayList;
4 |
5 |
6 | public class PagingList extends ArrayList {
7 |
8 | private static final long serialVersionUID = 5526933443772285251L;
9 |
10 | private int mTotalSize;
11 |
12 | /**
13 | * return total size of your query condition
14 | * @return
15 | */
16 | public int getTotalSize(){
17 | return mTotalSize;
18 | }
19 |
20 | /**
21 | * return size of this paing query
22 | */
23 | public int size() {
24 | return super.size();
25 | }
26 |
27 | void setTotalSize(int totalSize){
28 | this.mTotalSize = totalSize;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/popup_menu_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/activity/base/popupwindow/PopupSlideBottom.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.activity.base.popupwindow;
2 |
3 | import android.content.Context;
4 |
5 | import com.youngmanster.collection.R;
6 | import com.youngmanster.collectionlibrary.base.dialog.BasePopupWindow;
7 |
8 | /**
9 | * Created by yangyan
10 | * on 2018/6/7.
11 | */
12 |
13 | public class PopupSlideBottom extends BasePopupWindow {
14 |
15 | public PopupSlideBottom(Context context) {
16 | super(context);
17 | }
18 |
19 | @Override
20 | public int getPopupLayoutRes() {
21 | return R.layout.popup_slide_bottom;
22 | }
23 |
24 | @Override
25 | public int getPopupAnimationStyleRes() {
26 | return R.style.animation_bottom;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/mvp/ClassGetUtil.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.mvp;
2 |
3 | import java.lang.reflect.ParameterizedType;
4 |
5 | /**
6 | * 获取类实例
7 | * Created by yangyan
8 | * on 2018/3/18.
9 | */
10 |
11 | public class ClassGetUtil {
12 |
13 | public static T getClass(Object o, int i) {
14 | try {
15 | return ((Class) ((ParameterizedType) (o.getClass()
16 | .getGenericSuperclass())).getActualTypeArguments()[i])
17 | .newInstance();
18 | } catch (InstantiationException e) {
19 | } catch (IllegalAccessException e) {
20 | } catch (ClassCastException e) {
21 | }
22 | return null;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_wechat_news.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/layout/collection_library_default_base_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
11 |
12 |
13 |
18 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/layout/collection_library_default_base_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
11 |
12 |
13 |
18 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/rx/RxObservableListener.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.network.rx;
2 |
3 | import com.youngmanster.collectionlibrary.network.NetWorkCodeException;
4 |
5 | /**
6 | * Created by yangyan
7 | * on 2018/3/23.
8 | */
9 |
10 | public abstract class RxObservableListener implements ObservableListener{
11 |
12 |
13 | protected RxObservableListener(){
14 | }
15 |
16 | @Override
17 | public void onDownloadProgress(long total, long currentLength, float progress) {
18 |
19 | }
20 |
21 | @Override
22 | public void onUploadProgress(long total, float progress) {
23 |
24 | }
25 |
26 |
27 |
28 | @Override
29 | public void onError(NetWorkCodeException.ResponseThrowable e) {
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/drawable/lift_on_touch.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
7 |
8 |
13 |
14 |
15 | -
16 |
17 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/rx/RxManager.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.network.rx;
2 |
3 | import io.reactivex.disposables.CompositeDisposable;
4 | import io.reactivex.observers.DisposableObserver;
5 |
6 | /**
7 | * Observables 和 Subscribers管理
8 | * Created by yangyan
9 | * on 2018/3/17.
10 | */
11 |
12 | public class RxManager {
13 | private CompositeDisposable compositeDisposable=new CompositeDisposable();
14 |
15 | /**
16 | * 添加observer
17 | * @param observer
18 | */
19 | public void addObserver(DisposableObserver observer){
20 | if(observer!=null){
21 | compositeDisposable.add(observer);
22 | }
23 | }
24 |
25 |
26 | public void clear(){
27 | compositeDisposable.dispose();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/layout/collection_library_dialog_title_text_two_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
22 |
23 |
--------------------------------------------------------------------------------
/app/config.gradle:
--------------------------------------------------------------------------------
1 | ext{
2 | supportLibrary="27.1.1"
3 |
4 | supportDependencies=[
5 | design : "com.android.support:design:${supportLibrary}",
6 | appCompat : "com.android.support:appcompat-v7:${supportLibrary}",
7 | cardView : "com.android.support:cardview-v7:${supportLibrary}",
8 | ]
9 |
10 | thirdDependencies=[
11 | butterknife : "com.jakewharton:butterknife:8.8.1",
12 | butterknifeCompiler : "com.jakewharton:butterknife-compiler:8.8.1",
13 | multidex : "com.android.support:multidex:1.0.1"
14 | ]
15 |
16 | app=[
17 | compileSdkVersion : 26,
18 | minSdkVersion : 21,
19 | targetSdkVersion : 23,
20 | versionCode : 1,
21 | versionName : "1.0"
22 | ]
23 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_popup_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
17 |
18 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
13 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/activity/base/popupwindow/PopupTip.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.activity.base.popupwindow;
2 |
3 | import android.content.Context;
4 | import android.view.ViewGroup;
5 |
6 | import com.youngmanster.collection.R;
7 | import com.youngmanster.collectionlibrary.base.dialog.BasePopupWindow;
8 |
9 | /**
10 | * Created by yangyan
11 | * on 2018/6/7.
12 | */
13 |
14 | public class PopupTip extends BasePopupWindow {
15 |
16 | public PopupTip(Context context) {
17 | super(context, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
18 | setShowMaskView(false);
19 | }
20 |
21 | @Override
22 | public int getPopupLayoutRes() {
23 | return R.layout.popup_tip;
24 | }
25 |
26 | @Override
27 | public int getPopupAnimationStyleRes() {
28 | return R.style.animation_scale;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/activity/base/popupwindow/PopupSlideButton.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.activity.base.popupwindow;
2 |
3 | import android.content.Context;
4 | import android.view.ViewGroup;
5 |
6 | import com.youngmanster.collection.R;
7 | import com.youngmanster.collectionlibrary.base.dialog.BasePopupWindow;
8 |
9 | /**
10 | * Created by yangyan
11 | * on 2018/6/7.
12 | */
13 |
14 | public class PopupSlideButton extends BasePopupWindow {
15 |
16 | public PopupSlideButton(Context context) {
17 | super(context,ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
18 | setShowMaskView(false);
19 | }
20 |
21 | @Override
22 | public int getPopupLayoutRes() {
23 | return R.layout.popup_slide_button;
24 | }
25 |
26 | @Override
27 | public int getPopupAnimationStyleRes() {
28 | return 0;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/been/Result.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.been;
2 |
3 |
4 |
5 | import java.io.Serializable;
6 |
7 | /**
8 | * 根据接口规则写一个公用的接口数据类
9 | * Created by yangyan
10 | * on 2018/3/21.
11 | */
12 |
13 | public class Result implements Serializable {
14 |
15 | private int code;
16 | private String message;
17 | private T result;
18 |
19 | public int getCode() {
20 | return code;
21 | }
22 |
23 | public void setCode(int code) {
24 | this.code = code;
25 | }
26 |
27 | public String getMessage() {
28 | return message;
29 | }
30 |
31 | public void setMessage(String message) {
32 | this.message = message;
33 | }
34 |
35 | public T getResult() {
36 | return result;
37 | }
38 |
39 | public void setResult(T result) {
40 | this.result = result;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/data/database/DBTransaction.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.data.database;
2 |
3 | import android.database.sqlite.SQLiteDatabase;
4 |
5 | /**
6 | *
7 | */
8 | public class DBTransaction {
9 |
10 | private DBTransaction() {
11 | }
12 |
13 | /**
14 | * executes sqls in a transction
15 | */
16 | public static void transact(DbSqlite db, DBTransactionInterface transctionInterface){
17 | if(transctionInterface!=null){
18 | SQLiteDatabase sqliteDb = db.getSQLiteDatabase();
19 | sqliteDb.beginTransaction();
20 | try{
21 | transctionInterface.onTransact();
22 | sqliteDb.setTransactionSuccessful();
23 | }finally{
24 | sqliteDb.endTransaction();
25 | }
26 | }
27 | }
28 |
29 | public interface DBTransactionInterface{
30 | void onTransact();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/been/WeChatNewsResult.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.been;
2 |
3 | import com.youngmanster.collection.been.wechat.WeChatNews;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * Created by yangyan
9 | * on 2018/5/13.
10 | */
11 |
12 | public class WeChatNewsResult {
13 | private int code;
14 | private String message;
15 | private List result;
16 |
17 | public int getCode() {
18 | return code;
19 | }
20 |
21 | public void setCode(int code) {
22 | this.code = code;
23 | }
24 |
25 | public String getMessage() {
26 | return message;
27 | }
28 |
29 | public void setMessage(String message) {
30 | this.message = message;
31 | }
32 |
33 | public List getResult() {
34 | return result;
35 | }
36 |
37 | public void setResult(List result) {
38 | this.result = result;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/convert/ParameterizedTypeImpl.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.network.convert;
2 |
3 | import java.lang.reflect.ParameterizedType;
4 | import java.lang.reflect.Type;
5 |
6 | /**
7 | * Created by yangyan
8 | * on 2018/3/24.
9 | */
10 |
11 | public class ParameterizedTypeImpl implements ParameterizedType {
12 | private final Class raw;
13 | private final Type[] args;
14 | public ParameterizedTypeImpl(Class raw, Type[] args) {
15 | this.raw = raw;
16 | this.args = args != null ? args : new Type[0];
17 | }
18 | @Override
19 | public Type[] getActualTypeArguments() {
20 | return args;
21 | }
22 | @Override
23 | public Type getRawType() {
24 | return raw;
25 | }
26 | @Override
27 | public Type getOwnerType() {return null;}
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/activity/base/adapter/PopupMenuListAdapter.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.activity.base.adapter;
2 |
3 | import android.content.Context;
4 |
5 | import com.youngmanster.collection.R;
6 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseRecyclerViewAdapter;
7 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseViewHolder;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * Created by yangyan
13 | * on 2018/6/7.
14 | */
15 |
16 | public class PopupMenuListAdapter extends BaseRecyclerViewAdapter {
17 | public PopupMenuListAdapter(Context mContext,List mDatas) {
18 | super(mContext, R.layout.item_popup, mDatas);
19 | }
20 |
21 | @Override
22 | protected void convert(BaseViewHolder baseViewHolder, String s) {
23 | baseViewHolder.setText(R.id.tvTxt,s);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/utils/ColorUtils.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.utils;
2 |
3 | import android.content.res.ColorStateList;
4 | import android.graphics.Color;
5 |
6 | /**
7 | * Created by yangy
8 | * 2020-02-25
9 | * Describe:
10 | */
11 | public class ColorUtils {
12 |
13 | public static ColorStateList createColorStateList(String selected, String pressed, String normal) {
14 | int[] colors = new int[] {Color.parseColor(selected), Color.parseColor(pressed), Color.parseColor(normal) };
15 | int[][] states = new int[3][];
16 | states[0] = new int[] { android.R.attr.state_selected};
17 | states[1] = new int[] { android.R.attr.state_pressed};
18 | states[2] = new int[] {};
19 | ColorStateList colorList = new ColorStateList(states, colors);
20 | return colorList;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/customview/tagview/layout/FlexWrap.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.customview.tagview.layout;
2 |
3 |
4 | import android.support.annotation.IntDef;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.RetentionPolicy;
8 |
9 | /**
10 | * Created by yangy
11 | * 2020-02-25
12 | * Describe:
13 | */
14 | @IntDef({FlexWrap.NOWRAP, FlexWrap.WRAP, FlexWrap.WRAP_REVERSE})
15 | @Retention(RetentionPolicy.SOURCE)
16 | public @interface FlexWrap {
17 |
18 | /** The flex container is single-line. */
19 | int NOWRAP = 0;
20 |
21 | /** The flex container is multi-line. */
22 | int WRAP = 1;
23 |
24 | /**
25 | * The flex container is multi-line. The direction of the
26 | * cross axis is opposed to the direction as the {@link #WRAP}
27 | */
28 | int WRAP_REVERSE = 2;
29 | }
30 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/rx/RxSchedulers.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.network.rx;
2 |
3 | import io.reactivex.Observable;
4 | import io.reactivex.ObservableSource;
5 | import io.reactivex.ObservableTransformer;
6 | import io.reactivex.android.schedulers.AndroidSchedulers;
7 | import io.reactivex.schedulers.Schedulers;
8 |
9 | /**
10 | * 线程调度
11 | * Created by yangyan
12 | * on 2018/3/17.
13 | */
14 |
15 | public class RxSchedulers {
16 | public static ObservableTransformer io_main(){
17 | return new ObservableTransformer() {
18 | @Override
19 | public ObservableSource apply(Observable observable) {
20 | return observable.subscribeOn(Schedulers.io())
21 | .observeOn(AndroidSchedulers.mainThread());
22 | }
23 | };
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 | # Jenkins配置
19 | IS_JENKINS=false
20 | VERSION_NAME=1.0
21 | VERSION_CODE=128
22 | BUILD_TYPE=''
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/activity/base/adapter/ItemRecycleAdapter.java:
--------------------------------------------------------------------------------
1 |
2 | package com.youngmanster.collection.activity.base.adapter;
3 |
4 | import android.content.Context;
5 | import com.youngmanster.collection.R;
6 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseRecyclerViewAdapter;
7 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseViewHolder;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * 批量订阅
13 | */
14 | public class ItemRecycleAdapter extends BaseRecyclerViewAdapter {
15 | private Context context;
16 | private int operationType;
17 |
18 | public ItemRecycleAdapter(Context mContext,List mDatas) {
19 | super(mContext, R.layout.item_layout, mDatas);
20 | }
21 |
22 | @Override
23 | protected void convert(BaseViewHolder baseViewHolder, String s) {
24 | baseViewHolder.setText(R.id.tv_Label,s);
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/youngmanster/collection/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.youngmanster.collection", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_root.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
15 |
16 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
22 |
23 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/collectionlibrary/src/androidTest/java/com/youngmanster/collectionlibrary/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.youngmanster.collectionlibrary.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_google_refresh.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/convert/SetterExclusionStrategy.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.network.convert;
2 |
3 | import android.text.TextUtils;
4 |
5 | import com.google.gson.ExclusionStrategy;
6 | import com.google.gson.FieldAttributes;
7 |
8 | public class SetterExclusionStrategy implements ExclusionStrategy {
9 |
10 | private String field;
11 |
12 | public SetterExclusionStrategy(String field) {
13 | this.field = field;
14 | }
15 |
16 | @Override
17 | public boolean shouldSkipField(FieldAttributes f) {
18 | if (!TextUtils.isEmpty(field)) {
19 | if (f.getName().equals(field)) {
20 | /** true 代表此字段要过滤 */
21 | return true;
22 | }
23 | }
24 |
25 | return false;
26 | }
27 |
28 | @Override
29 | public boolean shouldSkipClass(Class> clazz) {
30 | return false;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_custom_tablayout_one.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
18 |
19 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_custom_tablayout_seven.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
16 |
17 |
21 |
22 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/activity/base/activity/UseFragmentActivity.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.activity.base.activity;
2 | import com.youngmanster.collection.R;
3 | import com.youngmanster.collection.activity.base.fragment.FragmentRoot;
4 | import com.youngmanster.collection.base.BaseActivity;
5 | /**
6 | * @author yangyan
7 | * @Date on 2019/8/27
8 | * @ Description:
9 | */
10 | public class UseFragmentActivity extends BaseActivity {
11 | @Override
12 | public int getLayoutId() {
13 | return R.layout.activity_use_fragment;
14 | }
15 |
16 | @Override
17 | public void init() {
18 | startFragment(FragmentRoot.class);
19 | }
20 |
21 | @Override
22 | public void requestData() {
23 |
24 | }
25 |
26 | @Override
27 | public boolean isShowCustomActionBar() {
28 | return false;
29 | }
30 |
31 | @Override
32 | public int fragmentLayoutId() {
33 | return R.id.fl_container;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_wechat_news1.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
12 |
13 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/rx/utils/IRxUITask.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 xuexiangjys(xuexiangjys@163.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.youngmanster.collectionlibrary.network.rx.utils;
18 |
19 | /**
20 | * 在UI线程中操作的任务
21 | *
22 | */
23 | public interface IRxUITask {
24 |
25 | /**
26 | * 在UI线程中执行
27 | * @param t 任务执行的入参
28 | */
29 | void doInUIThread(T t);
30 | }
31 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/layout/collection_library_view_empty.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
16 |
17 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/rx/utils/IRxIOTask.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 xuexiangjys(xuexiangjys@163.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.youngmanster.collectionlibrary.network.rx.utils;
18 |
19 | /**
20 | * 在IO线程中执行的任务**/
21 | public interface IRxIOTask {
22 |
23 | /**
24 | * 在IO线程中执行
25 | * @param t 任务执行的入参
26 | * @return R 任务执行的出参
27 | */
28 | R doInIOThread(T t);
29 | }
30 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/layout/collection_library_view_disconnect.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
16 |
17 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/rx/utils/IExceptionHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 xuexiangjys(xuexiangjys@163.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.youngmanster.collectionlibrary.network.rx.utils;
18 |
19 | /**
20 | * 错误信息处理者
21 | */
22 | public interface IExceptionHandler {
23 |
24 | /**
25 | * 处理过滤错误信息
26 | * @param e
27 | * @return
28 | */
29 | RxException handleException(Throwable e);
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_data_manager.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
20 |
21 |
22 |
23 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
17 |
18 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | 下拉刷新
3 | 释放刷新
4 | 刷新完成
5 | 正在刷新...
6 | 上次更新时间:
7 | 正在加载...
8 | 没有更多数据
9 | 确定
10 | 取消
11 | 请稍等...
12 |
13 | 刚刚
14 | 秒前
15 | 分钟前
16 | 小时前
17 | 天前
18 | 月前
19 | 年前
20 |
21 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/test/java/com/youngmanster/collection/activity/MainActivityTest.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.activity;
2 |
3 | import com.youngmanster.collection.BuildConfig;
4 | import com.youngmanster.collection.common.AppApplication;
5 |
6 | import org.junit.Before;
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 | import org.robolectric.Robolectric;
10 | import org.robolectric.RobolectricTestRunner;
11 | import org.robolectric.annotation.Config;
12 |
13 | import static org.junit.Assert.assertNotNull;
14 |
15 | /**
16 | * Created by yangy
17 | * 2019-12-08
18 | * Describe:
19 | */
20 | @RunWith(RobolectricTestRunner.class)
21 | @Config(application = AppApplication.class,sdk = 21)
22 | public class MainActivityTest {
23 | private MainActivity mainActivity;
24 |
25 | @Before
26 | public void setUp() {
27 | mainActivity= Robolectric.buildActivity(MainActivity.class)
28 | .create()
29 | .resume()
30 | .get();
31 | }
32 | @Test
33 | public void onCLick(){
34 | assertNotNull(mainActivity);
35 | }
36 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/been/MultiItem.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.been;
2 |
3 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseMultiItemEntity;
4 |
5 | /**
6 | * Created by yangyan
7 | * on 2018/3/14.
8 | */
9 |
10 | public class MultiItem implements BaseMultiItemEntity {
11 |
12 | public final static int TYPE_TEXT=1;
13 | public final static int TYPE_IMG=2;
14 | public final static int TYPE_TEXT_IMG=3;
15 |
16 | private String title;
17 | private int res;
18 | private int type;
19 |
20 | public String getTitle() {
21 | return title;
22 | }
23 |
24 | public void setTitle(String title) {
25 | this.title = title;
26 | }
27 |
28 | public int getType() {
29 | return type;
30 | }
31 |
32 | public void setType(int type) {
33 | this.type = type;
34 | }
35 |
36 | public int getRes() {
37 | return res;
38 | }
39 |
40 | public void setRes(int res) {
41 | this.res = res;
42 | }
43 |
44 | @Override
45 | public int getItemViewType() {
46 | return getType();
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/customview/tagview/layout/AlignItems.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.customview.tagview.layout;
2 |
3 |
4 | import android.support.annotation.IntDef;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.RetentionPolicy;
8 |
9 | /**
10 | * Created by yangy
11 | * 2020-02-25
12 | * Describe:
13 | */
14 | @IntDef({AlignItems.FLEX_START, AlignItems.FLEX_END, AlignItems.CENTER,
15 | AlignItems.BASELINE, AlignItems.STRETCH})
16 | @Retention(RetentionPolicy.SOURCE)
17 | public @interface AlignItems {
18 |
19 | /** Flex item's edge is placed on the cross start line. */
20 | int FLEX_START = 0;
21 |
22 | /** Flex item's edge is placed on the cross end line. */
23 | int FLEX_END = 1;
24 |
25 | /** Flex item's edge is centered along the cross axis. */
26 | int CENTER = 2;
27 |
28 | /** Flex items are aligned based on their text's baselines. */
29 | int BASELINE = 3;
30 |
31 | /** Flex items are stretched to fill the flex line's cross size. */
32 | int STRETCH = 4;
33 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/adapter/baseadapter/DragAndDeleteAdapter.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.adapter.baseadapter;
2 |
3 | import android.content.Context;
4 |
5 | import com.youngmanster.collection.R;
6 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseRecyclerViewAdapter;
7 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseViewHolder;
8 | import com.youngmanster.collectionlibrary.utils.DisplayUtils;
9 |
10 | import java.util.List;
11 |
12 | /**Created by yangyan
13 | * on 2018/3/14.
14 | */
15 |
16 | public class DragAndDeleteAdapter extends BaseRecyclerViewAdapter {
17 |
18 | private int mHeight;
19 |
20 | public DragAndDeleteAdapter(Context mContext, List mDatas) {
21 | super(mContext, R.layout.item_main, mDatas);
22 | mHeight= DisplayUtils.dip2px(mContext,100);
23 | }
24 |
25 | @Override
26 | protected void convert(BaseViewHolder baseViewHolder, String s) {
27 | baseViewHolder.setText(R.id.title,s);
28 | baseViewHolder.getView(R.id.card_view).getLayoutParams().height=mHeight;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/activity/base/activity/PopupMenuActivity.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.activity.base.activity;
2 |
3 | import android.widget.LinearLayout;
4 |
5 | import com.youngmanster.collection.R;
6 | import com.youngmanster.collection.activity.base.popupwindow.PopupMenuList;
7 | import com.youngmanster.collection.base.BaseActivity;
8 |
9 | import butterknife.BindView;
10 | import butterknife.OnClick;
11 |
12 | /**
13 | * Created by yangyan
14 | * on 2018/6/7.
15 | */
16 |
17 | public class PopupMenuActivity extends BaseActivity {
18 |
19 | @BindView(R.id.clickLl)
20 | LinearLayout clickLl;
21 | @Override
22 | public int getLayoutId() {
23 | return R.layout.activity_popup_list;
24 | }
25 |
26 | @Override
27 | public void init() {
28 | defineActionBarConfig.setTitle(getString(R.string.popup_title));
29 | }
30 |
31 | @Override
32 | public void requestData() {
33 |
34 | }
35 |
36 | @OnClick(R.id.clickLl)
37 | public void onMenClick(){
38 | PopupMenuList popupMenuList=new PopupMenuList(this);
39 | popupMenuList.showPopupAsDropDown(clickLl);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_custom_tablayout_two.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
21 |
22 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/custom_tab_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
20 |
21 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_transparent_statusbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
14 |
15 |
16 |
24 |
25 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_main.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
18 |
19 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 YongEver
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/been/User.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.been;
2 |
3 |
4 | import com.youngmanster.collectionlibrary.data.database.Column;
5 |
6 | /**
7 | * Created by yangyan
8 | * on 2018/4/16.
9 | */
10 |
11 | public class User {
12 | @Column(isPrimaryKey =true)
13 | private int id;
14 | private String name;
15 | private int age;
16 | private String address;
17 | private String str;
18 |
19 | public String getStr() {
20 | return str;
21 | }
22 |
23 | public void setStr(String str) {
24 | this.str = str;
25 | }
26 |
27 | public int getId() {
28 | return id;
29 | }
30 |
31 | public void setId(int id) {
32 | this.id = id;
33 | }
34 |
35 | public String getName() {
36 | return name;
37 | }
38 |
39 | public void setName(String name) {
40 | this.name = name;
41 | }
42 |
43 | public int getAge() {
44 | return age;
45 | }
46 |
47 | public void setAge(int age) {
48 | this.age = age;
49 | }
50 |
51 | public String getAddress() {
52 | return address;
53 | }
54 |
55 | public void setAddress(String address) {
56 | this.address = address;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_custom_outsideframetablayout_one.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
22 |
23 |
24 |
29 |
30 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/utils/SoftInputUtils.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.utils;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.view.View;
6 | import android.view.inputmethod.InputMethodManager;
7 | import android.widget.EditText;
8 |
9 | /**
10 | * Created by yangyan on 2018/10/24
11 | * Describe:键盘控制
12 | **/
13 | public class SoftInputUtils {
14 | public static void hideSoftInput(Context context){
15 | View view = ((Activity)context).getWindow().peekDecorView();
16 | if (view != null) {
17 | InputMethodManager inputmanger = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
18 | inputmanger.hideSoftInputFromWindow(view.getWindowToken(), 0);
19 | }
20 | }
21 |
22 |
23 | public static void showSoftInput(EditText editText){
24 | InputMethodManager inputManager = (InputMethodManager) editText.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
25 | inputManager.toggleSoftInput(0,InputMethodManager.SHOW_FORCED);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/popup_tip.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
13 |
14 |
19 |
20 |
23 |
24 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/customview/fragment/ChildFragment.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.customview.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.widget.TextView;
5 |
6 | import com.youngmanster.collection.R;
7 | import com.youngmanster.collection.base.BaseFragment;
8 |
9 | import butterknife.BindView;
10 |
11 | /**
12 | * Created by yangyan
13 | * on 2018/6/26.
14 | */
15 |
16 | public class ChildFragment extends BaseFragment {
17 |
18 | @BindView(R.id.childTv)
19 | TextView childTv;
20 |
21 | public static ChildFragment newInstance(String str){
22 | ChildFragment childFragment = new ChildFragment();
23 | Bundle bundle = new Bundle();
24 | bundle.putString("str", str);
25 | childFragment.setArguments(bundle);
26 | return childFragment;
27 | }
28 |
29 |
30 | @Override
31 | public int getLayoutId() {
32 | return R.layout.fragment_child;
33 | }
34 |
35 | @Override
36 | public void init() {
37 | Bundle bundle = getArguments();
38 | String str = bundle.getString("str");
39 | childTv.setText(str);
40 | }
41 |
42 | @Override
43 | public void requestData() {
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/activity/base/fragment/FragmentT.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.activity.base.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.view.View;
5 |
6 | import com.youngmanster.collection.R;
7 | import com.youngmanster.collection.base.BaseFragment;
8 |
9 | import butterknife.OnClick;
10 |
11 | /**
12 | * @author yangyan
13 | * @Date on 2019/8/27
14 | * @ Description:
15 | */
16 | public class FragmentT extends BaseFragment {
17 |
18 |
19 |
20 | public static FragmentT newInstance() {
21 |
22 | Bundle args = new Bundle();
23 |
24 | FragmentT fragment = new FragmentT();
25 | fragment.setArguments(args);
26 | return fragment;
27 | }
28 |
29 | @Override
30 | public int getLayoutId() {
31 | return R.layout.fragment_t;
32 | }
33 |
34 | @Override
35 | public void init() {
36 |
37 | defineActionBarConfig.setTitle("跳转页面");
38 | }
39 |
40 | @Override
41 | public void requestData() {
42 |
43 | }
44 |
45 | @Override
46 | public boolean isShowCustomActionBar() {
47 | return true;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/adapter/recyclerview/DefinitionRecyclerAdapter.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.adapter.recyclerview;
2 |
3 | import android.content.Context;
4 |
5 | import com.youngmanster.collection.R;
6 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseRecyclerViewAdapter;
7 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseViewHolder;
8 | import com.youngmanster.collectionlibrary.refreshrecyclerview.pulltorefresh.PullToRefreshRecyclerView;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * Created by yangyan
14 | * on 2018/3/18.
15 | */
16 |
17 | public class DefinitionRecyclerAdapter extends BaseRecyclerViewAdapter {
18 |
19 | public DefinitionRecyclerAdapter(Context mContext, List mDatas, PullToRefreshRecyclerView pullToRefreshRecyclerView) {
20 | super(mContext, R.layout.item_pull_refresh, mDatas, pullToRefreshRecyclerView);
21 | }
22 |
23 | @Override
24 | protected void convert(BaseViewHolder baseViewHolder, String s) {
25 | baseViewHolder.setText(R.id.title,s);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/adapter/recyclerview/PullToRecyclerViewAdapter.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.adapter.recyclerview;
2 |
3 | import android.content.Context;
4 |
5 | import com.youngmanster.collection.R;
6 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseRecyclerViewAdapter;
7 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseViewHolder;
8 | import com.youngmanster.collectionlibrary.refreshrecyclerview.pulltorefresh.PullToRefreshRecyclerView;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * Created by yangyan
14 | * on 2018/3/18.
15 | */
16 |
17 | public class PullToRecyclerViewAdapter extends BaseRecyclerViewAdapter {
18 |
19 | public PullToRecyclerViewAdapter(Context mContext, List mDatas, PullToRefreshRecyclerView pullToRefreshRecyclerView) {
20 | super(mContext, R.layout.item_pull_refresh, mDatas, pullToRefreshRecyclerView);
21 | }
22 |
23 | @Override
24 | protected void convert(BaseViewHolder baseViewHolder, String s) {
25 | baseViewHolder.setText(R.id.title,s);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_transprent_statusbar_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
15 |
16 |
17 |
25 |
26 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_custom_tablayout_three.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
20 |
21 |
25 |
26 |
27 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_refresh.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
20 |
21 |
22 |
23 |
27 |
28 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/data/database/DateUtils.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.data.database;
2 |
3 | import java.text.DateFormat;
4 | import java.text.ParseException;
5 | import java.text.SimpleDateFormat;
6 | import java.util.Date;
7 | import java.util.Locale;
8 |
9 | /**
10 | * Created by yangy
11 | * 2020-02-26
12 | * Describe:
13 | */
14 | public class DateUtils {
15 | private final static DateFormat DF_SSS = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.getDefault());
16 | private final static DateFormat DF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss",Locale.getDefault());
17 |
18 | private DateUtils(){}
19 |
20 | static Date parseStr2Date(String str){
21 | try {
22 | if(str.endsWith(".SSS")){
23 | return DF_SSS.parse(str);
24 | }else{
25 | return DF.parse(str);
26 | }
27 | } catch (ParseException e) {
28 | e.printStackTrace();
29 | return null;
30 | }
31 | }
32 |
33 | static String formatDate2Str(Date date){
34 | return DF_SSS.format(date);
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/data/fragment/FragmentSharePreference.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.data.fragment;
2 | import android.view.View;
3 |
4 | import com.youngmanster.collection.R;
5 | import com.youngmanster.collection.base.BaseFragment;
6 | import com.youngmanster.collectionlibrary.data.DataManager;
7 |
8 | import butterknife.OnClick;
9 |
10 | /**
11 | * Created by yangyan
12 | * on 2018/3/21.
13 | */
14 |
15 | public class FragmentSharePreference extends BaseFragment{
16 |
17 | @Override
18 | public int getLayoutId() {
19 | return R.layout.fragment_sharepreference;
20 | }
21 |
22 | @Override
23 | public void init() {
24 | }
25 |
26 | @Override
27 | public void requestData() {
28 | }
29 |
30 |
31 | @OnClick({R.id.saveBtn,R.id.queryBtn})
32 | public void onMenuClick(View view){
33 | switch (view.getId()){
34 | case R.id.saveBtn:
35 |
36 | DataManager.DataForSharePreferences.saveObject("user","这是一条测试的内容");
37 | showToast("保存成功");
38 |
39 | break;
40 | case R.id.queryBtn:
41 | String con=DataManager.DataForSharePreferences.getObject("user","");
42 | showToast(con);
43 | break;
44 | }
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/values-zh-rTW/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 下拉刷新
5 | 釋放刷新
6 | 刷新完成
7 | 正在刷新...
8 | 上次更新時間:
9 | 正在加載...
10 | 沒有更多數據
11 | 確定
12 | 取消
13 | 請稍等...
14 |
15 | 剛剛
16 | 秒前
17 | 分鐘前
18 | 小時前
19 | 天前
20 | 月前
21 | 年前
22 |
23 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/layout/collection_library_dialog_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_wrap_linear.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
12 |
13 |
17 |
18 |
22 |
23 |
24 |
25 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_custom_tablayout_four.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
20 |
21 |
25 |
26 |
27 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_custom_tablayout_six.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
21 |
22 |
26 |
27 |
28 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/activity/base/fragment/FragmentRoot.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.activity.base.fragment;
2 | import android.view.View;
3 | import com.youngmanster.collection.R;
4 | import com.youngmanster.collection.base.BaseFragment;
5 | import butterknife.OnClick;
6 |
7 | /**
8 | * @author yangyan
9 | * @Date on 2019/8/27
10 | * @ Description:
11 | */
12 | public class FragmentRoot extends BaseFragment {
13 |
14 |
15 | @Override
16 | public int getLayoutId() {
17 | return R.layout.fragment_root;
18 | }
19 |
20 | @Override
21 | public void init() {
22 | defineActionBarConfig.setTitle("展示页面");
23 | }
24 |
25 | @Override
26 | public void requestData() {
27 | }
28 |
29 | @OnClick({R.id.btn1,R.id.btn2})
30 | public void onMenuClick(View view) {
31 | switch (view.getId()) {
32 | case R.id.btn1:
33 | startFragment(FragmentT.class);
34 | break;
35 | case R.id.btn2:
36 | startFragment(FragmentT.class,true);
37 | break;
38 | }
39 |
40 | }
41 |
42 | @Override
43 | public boolean isShowCustomActionBar() {
44 | return true;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_empty.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
22 |
23 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_custom_tablayout_five.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
22 |
23 |
27 |
28 |
29 |
34 |
35 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/base/activity/ResultCode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © Yan Zhenjie. All Rights Reserved
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.youngmanster.collectionlibrary.base.activity;
17 |
18 | import android.support.annotation.IntDef;
19 |
20 | import com.youngmanster.collectionlibrary.base.fragmet.IBaseFragment;
21 |
22 | import java.lang.annotation.Retention;
23 | import java.lang.annotation.RetentionPolicy;
24 |
25 | /**
26 | * Created by Yan Zhenjie on 2017/1/15.
27 | */
28 | @IntDef({IBaseFragment.RESULT_OK, IBaseFragment.RESULT_CANCELED})
29 | @Retention(RetentionPolicy.SOURCE)
30 | public @interface ResultCode {
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_pull_refresh.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
18 |
19 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/rx/utils/SimpleThrowableAction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 xuexiangjys(xuexiangjys@163.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.youngmanster.collectionlibrary.network.rx.utils;
18 |
19 |
20 | import io.reactivex.functions.Consumer;
21 |
22 |
23 | /**
24 | * 简单的出错处理(把错误打印出来)
25 | */
26 | public final class SimpleThrowableAction implements Consumer {
27 |
28 | private String mTag;
29 |
30 | public SimpleThrowableAction(String tag) {
31 | mTag = tag;
32 | }
33 |
34 | @Override
35 | public void accept(Throwable throwable) throws Exception {
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_downlaod.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
15 |
16 |
23 |
24 |
25 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/RequestManager.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.network;
2 | import com.youngmanster.collectionlibrary.network.request.RequestMethodImpl;
3 | import com.youngmanster.collectionlibrary.network.synchronization.OkHttpUtils;
4 |
5 | import io.reactivex.observers.DisposableObserver;
6 | import okhttp3.ResponseBody;
7 |
8 | /**
9 | * 请求管理
10 | * Created by yangyan
11 | * on 2018/3/23.
12 | */
13 |
14 | public class RequestManager {
15 |
16 | private RequestMethodImpl requestMethod;
17 |
18 | private static class SingletonHolder{
19 | private static final RequestManager INSTANCE = new RequestManager();
20 | }
21 |
22 | public static RequestManager getInstance() {
23 | return SingletonHolder.INSTANCE;
24 | }
25 |
26 | private RequestManager() {
27 | requestMethod=new RequestMethodImpl();
28 | }
29 |
30 | public DisposableObserver request(RequestBuilder builder) {
31 | if (builder.getReqMode() == RequestBuilder.ReqMode.ASYNCHRONOUS) {
32 | return requestMethod.request(builder);
33 | } else {
34 | OkHttpUtils.requestSyncData(builder);
35 | }
36 | return null;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/rx/utils/RxUITask.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 xuexiangjys(xuexiangjys@163.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.youngmanster.collectionlibrary.network.rx.utils;
18 |
19 | /**
20 | * UI线程中操作的任务
21 | */
22 | public abstract class RxUITask implements IRxUITask {
23 | /**
24 | * UI执行任务的入参
25 | */
26 | private T InData;
27 |
28 | public RxUITask(T inData) {
29 | InData = inData;
30 | }
31 |
32 | public T getInData() {
33 | return InData;
34 | }
35 |
36 | public RxUITask setInData(T inData) {
37 | InData = inData;
38 | return this;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/customview/CollectionViewPager.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.customview;
2 |
3 | import android.content.Context;
4 | import android.support.v4.view.ViewPager;
5 | import android.util.AttributeSet;
6 | import android.view.MotionEvent;
7 |
8 | /**
9 | * Created by yangyan
10 | * on 2018/3/18.
11 | */
12 |
13 | public class CollectionViewPager extends ViewPager{
14 |
15 | private boolean scrollable = true;
16 |
17 | public CollectionViewPager(Context context) {
18 | super(context);
19 | }
20 |
21 | public CollectionViewPager(Context context, AttributeSet attrs) {
22 | super(context, attrs);
23 | }
24 |
25 | public void setScrollable(boolean enable) {
26 | scrollable = enable;
27 | }
28 |
29 | @Override
30 | public boolean onInterceptTouchEvent(MotionEvent ev) {
31 | if(scrollable){
32 | return super.onInterceptTouchEvent(ev);
33 | }else{
34 | return false;
35 | }
36 | }
37 |
38 | @Override
39 | public boolean onTouchEvent(MotionEvent ev) {
40 | if(scrollable){
41 | return super.onTouchEvent(ev);
42 | }else{
43 | return false;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/rx/utils/RxIOTask.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 xuexiangjys(xuexiangjys@163.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.youngmanster.collectionlibrary.network.rx.utils;
18 |
19 | /**
20 | * IO线程中操作的任务
21 | *
22 | */
23 | public abstract class RxIOTask implements IRxIOTask {
24 | /**
25 | * IO执行任务的入参
26 | */
27 | private T InData;
28 |
29 | public RxIOTask(T inData) {
30 | InData = inData;
31 | }
32 |
33 | public T getInData() {
34 | return InData;
35 | }
36 |
37 | public RxIOTask setInData(T inData) {
38 | InData = inData;
39 | return this;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_sharepreference.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
19 |
20 |
21 |
29 |
30 |
31 |
39 |
40 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Pull down to refresh
4 | Release refresh
5 | Refresh complete
6 | Refreshing...
7 | Last updated:
8 | loading...
9 | No more data
10 | Determine
11 | Cancel
12 | Please wait...
13 |
14 | just a moment ago
15 | seconds ago
16 | minutes ago
17 | hours ago
18 | days ago
19 | months ago
20 | years ago
21 |
22 |
23 |
--------------------------------------------------------------------------------
/collectionlibrary/config.gradle:
--------------------------------------------------------------------------------
1 | ext{
2 | supportLibrary="27.1.1"
3 |
4 | supportDependencies=[
5 | appCompat : "com.android.support:appcompat-v7:${supportLibrary}",
6 | recyclerview : "com.android.support:recyclerview-v7:${supportLibrary}"
7 | ]
8 |
9 | thirdDependencies=[
10 | rxjava : "io.reactivex.rxjava2:rxjava:2.2.2",
11 | rxandroid : "io.reactivex.rxjava2:rxandroid:2.1.0",
12 | retrofit : "com.squareup.retrofit2:retrofit:2.6.1",
13 | gsonConverter : "com.squareup.retrofit2:converter-gson:2.6.1",
14 | rxjavaAdapter : "com.squareup.retrofit2:adapter-rxjava2:2.6.1",
15 | loggingInterceptor : "com.squareup.okhttp3:logging-interceptor:4.1.0",
16 | avi : "com.wang.avi:library:2.1.3",
17 | glideTransformation : "jp.wasabeef:glide-transformations:4.1.0",
18 | glide : "com.github.bumptech.glide:glide:4.7.1",
19 | glideCompiler : "com.github.bumptech.glide:compiler:4.7.1",
20 | ]
21 |
22 | app=[
23 | compileSdkVersion : 26,
24 | minSdkVersion : 21,
25 | targetSdkVersion : 23,
26 | versionCode : 1,
27 | versionName : "1.0"
28 | ]
29 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/adapter/CollectionFragmentAdapter.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.adapter;
2 |
3 | import android.content.Context;
4 | import android.support.v4.app.Fragment;
5 | import android.support.v4.app.FragmentManager;
6 | import android.support.v4.app.FragmentPagerAdapter;
7 | import android.support.v4.view.PagerAdapter;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * Created by yangyan
13 | * on 2018/3/18.
14 | */
15 |
16 | public class CollectionFragmentAdapter extends FragmentPagerAdapter {
17 |
18 | private Context context;
19 | private List fragmentList;
20 |
21 | public CollectionFragmentAdapter(FragmentManager fm,List fragmentList) {
22 | super(fm);
23 | this.fragmentList = fragmentList;
24 | }
25 |
26 | @Override
27 | public Fragment getItem(int position) {
28 | return (fragmentList == null || fragmentList.size() == 0) ? null : fragmentList.get(position);
29 | }
30 |
31 | @Override
32 | public int getCount() {
33 | return fragmentList == null ? 0 : fragmentList.size();
34 | }
35 |
36 | @Override
37 | public int getItemPosition(Object object) {
38 | //return PagerAdapter.POSITION_NONE;
39 | return PagerAdapter.POSITION_NONE;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_custom_outsideframetablayout_two.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
28 |
29 |
30 |
35 |
36 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/data/database/SQLiteVersionMigrate.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.data.database;
2 |
3 | import com.youngmanster.collectionlibrary.config.Config;
4 | import com.youngmanster.collectionlibrary.data.DataManager;
5 |
6 | /**
7 | * Created by yangy
8 | * 2020-02-27
9 | * Describe:
10 | */
11 | public class SQLiteVersionMigrate {
12 |
13 |
14 | public interface MigrateListener {
15 | void onMigrate(int oldVersion, int newVersion);
16 | }
17 |
18 | public void setMigrateListener(MigrateListener migrate) {
19 | boolean isFirst= DataManager.DataForSharePreferences.getObject(SqlHelper.isFirstUseKey,true);
20 |
21 | if(isFirst){
22 | DataManager.DataForSharePreferences.saveObject(SqlHelper.isFirstUseKey,false);
23 | DataManager.DataForSharePreferences.saveObject(SqlHelper.PREFS_TABLE_VERSION_KEY, Config.SQLITE_DB_VERSION);
24 | }else{
25 | int tableVersion = DataManager.DataForSharePreferences.getObject(
26 | SqlHelper.PREFS_TABLE_VERSION_KEY,
27 | 0
28 | );
29 |
30 | if (Config.SQLITE_DB_VERSION > tableVersion) {
31 | migrate.onMigrate(tableVersion, Config.SQLITE_DB_VERSION);
32 | }
33 | }
34 |
35 |
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/base/BaseActivity.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.base;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.view.View;
6 |
7 | import com.youngmanster.collection.R;
8 | import com.youngmanster.collectionlibrary.base.activity.IBaseActivity;
9 | import com.youngmanster.collectionlibrary.mvp.BasePresenter;
10 |
11 | import butterknife.ButterKnife;
12 | import butterknife.Unbinder;
13 |
14 | /**
15 | * Created by yangyan
16 | * on 2018/3/18.
17 | */
18 |
19 | public abstract class BaseActivity extends IBaseActivity {
20 | private Unbinder unbinder;
21 |
22 | @Override
23 | protected void onCreate(@Nullable Bundle savedInstanceState) {
24 | super.onCreate(savedInstanceState);
25 | unbinder= ButterKnife.bind(this);
26 |
27 | defineActionBarConfig
28 | .setBackIcon(R.mipmap.ic_back_btn)
29 | .setBackClick(new View.OnClickListener() {
30 | @Override
31 | public void onClick(View v) {
32 | onBackPressed();
33 | }
34 | });
35 | }
36 |
37 | @Override
38 | public void onDestroy() {
39 | super.onDestroy();
40 | unbinder.unbind();
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/rx/utils/RxTaskOnSubscribe.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 xuexiangjys(xuexiangjys@163.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.youngmanster.collectionlibrary.network.rx.utils;
18 |
19 |
20 | import io.reactivex.FlowableOnSubscribe;
21 |
22 | /**
23 | * 在订阅时执行的回调
24 | *
25 | */
26 | public abstract class RxTaskOnSubscribe implements FlowableOnSubscribe {
27 | /**
28 | * 在订阅时执行的任务
29 | */
30 | private T mTask;
31 |
32 | public RxTaskOnSubscribe(T task) {
33 | mTask = task;
34 | }
35 |
36 | public T getTask() {
37 | return mTask;
38 | }
39 |
40 | public RxTaskOnSubscribe setTask(T task) {
41 | mTask = task;
42 | return this;
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/app/jacoco.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'jacoco'
2 | jacoco {
3 | toolVersion = "0.8.5" //指定jacoco的版本
4 | reportsDir = file("$buildDir/JacocoReport") //指定jacoco生成报告的文件夹
5 | }
6 |
7 | tasks.withType(Test) {
8 | jacoco.includeNoLocationClasses = true
9 | }
10 |
11 | android {
12 | buildTypes {
13 | debug {
14 | //打开覆盖率统计开关
15 | testCoverageEnabled = true
16 | }
17 | }
18 | }
19 |
20 | //依赖于testDebugUnitTest任务
21 | task jacocoTestReport(type: JacocoReport, dependsOn: 'testDebugUnitTest') {
22 | group = "reporting" //指定task的分组
23 | reports {
24 | xml.enabled = true //开启xml报告
25 | html.enabled = true //开启html报告
26 | }
27 |
28 | //过滤的路径
29 | def fileFilters = [
30 | '**/R.class',
31 | '**/R$*.class',
32 | '**/BuildConfig.*',
33 | '**/Manifest*.*',
34 | 'com/android/**/*.class'
35 | ]
36 | //需要统计的class地址
37 | def javaDebugTree = fileTree(dir: "${buildDir}/intermediates/javac/debug", excludes: fileFilters)
38 | def kotlinDebugTree = fileTree(dir: "${buildDir}/tmp/kotlin-classes/debug", excludes: fileFilters)
39 |
40 | //需要统计的源码地址
41 | sourceDirectories = files(['src/main/java'])
42 | classDirectories = files([javaDebugTree, kotlinDebugTree])
43 | //结果文件
44 | executionData = files("${buildDir}/jacoco/testDebugUnitTest.exec")
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/download/DownloadInfo.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.network.download;
2 |
3 | /**
4 | * Created by yangy
5 | * 2020/9/20
6 | * Describe:
7 | */
8 | public class DownloadInfo {
9 | private String url;
10 | private long total;
11 | private long progress;
12 | private String fileName;
13 | private String filePath;
14 |
15 | public DownloadInfo(String url) {
16 | this.url = url;
17 | }
18 |
19 | public String getUrl() {
20 | return url;
21 | }
22 |
23 | public void setUrl(String url) {
24 | this.url = url;
25 | }
26 |
27 | public long getTotal() {
28 | return total;
29 | }
30 |
31 | public void setTotal(long total) {
32 | this.total = total;
33 | }
34 |
35 | public long getProgress() {
36 | return progress;
37 | }
38 |
39 | public void setProgress(long progress) {
40 | this.progress = progress;
41 | }
42 |
43 | public String getFileName() {
44 | return fileName;
45 | }
46 |
47 | public void setFileName(String fileName) {
48 | this.fileName = fileName;
49 | }
50 |
51 | public String getFilePath() {
52 | return filePath;
53 | }
54 |
55 | public void setFilePath(String filePath) {
56 | this.filePath = filePath;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/customview/tagview/layout/AlignSelf.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.customview.tagview.layout;
2 |
3 |
4 | import android.support.annotation.IntDef;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.RetentionPolicy;
8 |
9 | /**
10 | * Created by yangy
11 | * 2020-02-25
12 | * Describe:
13 | */
14 | @IntDef({AlignItems.FLEX_START, AlignItems.FLEX_END, AlignItems.CENTER,
15 | AlignItems.BASELINE, AlignItems.STRETCH, AlignSelf.AUTO})
16 | @Retention(RetentionPolicy.SOURCE)
17 | public @interface AlignSelf {
18 |
19 | /**
20 | * The default value for the AlignSelf attribute, which means use the inherit
21 | * the {@link AlignItems} attribute from its parent.
22 | */
23 | int AUTO = -1;
24 |
25 | /** This item's edge is placed on the cross start line. */
26 | int FLEX_START = AlignItems.FLEX_START;
27 |
28 | /** This item's edge is placed on the cross end line. */
29 | int FLEX_END = AlignItems.FLEX_END;
30 |
31 | /** This item's edge is centered along the cross axis. */
32 | int CENTER = AlignItems.CENTER;
33 |
34 | /** This items is aligned based on their text's baselines. */
35 | int BASELINE = AlignItems.BASELINE;
36 |
37 | /** This item is stretched to fill the flex line's cross size. */
38 | int STRETCH = AlignItems.STRETCH;
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/adapter/baseadapter/ItemClickAdapter.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.adapter.baseadapter;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 | import android.widget.CheckBox;
6 |
7 | import com.youngmanster.collection.R;
8 | import com.youngmanster.collection.been.ClickItem;
9 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseRecyclerViewAdapter;
10 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseViewHolder;
11 |
12 | import java.util.List;
13 |
14 | /**
15 | * Created by yangyan
16 | * on 2018/3/20.
17 | */
18 |
19 | public class ItemClickAdapter extends BaseRecyclerViewAdapter {
20 |
21 | private View.OnClickListener onClickListener;
22 |
23 | public ItemClickAdapter(Context mContext, List mDatas, View.OnClickListener onClickListener) {
24 | super(mContext, R.layout.item_click, mDatas);
25 | this.onClickListener = onClickListener;
26 | }
27 |
28 | @Override
29 | protected void convert(BaseViewHolder baseViewHolder, ClickItem clickItem) {
30 | baseViewHolder.setText(R.id.titleTv, clickItem.getTitle())
31 | .setImageResource(R.id.ivImg, clickItem.getRes())
32 | .setOnClickListener(R.id.clickTv, onClickListener);
33 |
34 | baseViewHolder.getView(R.id.clickTv).setVisibility(View.VISIBLE);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/rx/RxSubscriber.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.network.rx;
2 |
3 | import com.youngmanster.collectionlibrary.network.NetWorkCodeException;
4 | import com.youngmanster.collectionlibrary.utils.LogUtils;
5 |
6 | import io.reactivex.observers.DisposableObserver;
7 |
8 | /**
9 | * Observer的处理事件
10 | * Created by yangyan
11 | * on 2018/3/17.
12 | */
13 |
14 | public abstract class RxSubscriber extends DisposableObserver{
15 |
16 | @Override
17 | public void onNext(T t) {
18 | if (isDisposed()) {
19 | return;
20 | }else{
21 | dispose();
22 | }
23 | _onNext(t);
24 | }
25 |
26 | @Override
27 | public void onError(Throwable e) {
28 | if (isDisposed()) {
29 | return;
30 | }else{
31 | dispose();
32 | }
33 | _onError(NetWorkCodeException.getResponseThrowable(e));
34 | }
35 |
36 | @Override
37 | public void onComplete() {
38 | if (isDisposed()) {
39 | return;
40 | }else{
41 | dispose();
42 | }
43 | _onComplete();
44 | }
45 |
46 | /**
47 | * 定义处理事件
48 | */
49 | public abstract void _onNext(T t);
50 | public abstract void _onError(NetWorkCodeException.ResponseThrowable e);
51 | public abstract void _onComplete();
52 | }
53 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/data/database/ColumnInfo.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.data.database;
2 |
3 | /**
4 | */
5 | public class ColumnInfo {
6 |
7 | private boolean isPrimaryKey = false;
8 |
9 | private boolean isNull = true;
10 |
11 | private String name;
12 |
13 | private String type;
14 |
15 | private String defaultValue = "null";
16 |
17 | private boolean isUnique = false;
18 |
19 | public boolean isPrimaryKey() {
20 | return isPrimaryKey;
21 | }
22 |
23 | public void setPrimaryKey(boolean isPrimaryKey) {
24 | this.isPrimaryKey = isPrimaryKey;
25 | }
26 |
27 | public boolean isNull() {
28 | return isNull;
29 | }
30 |
31 | public void setNull(boolean isNull) {
32 | this.isNull = isNull;
33 | }
34 |
35 | public String getName() {
36 | return name;
37 | }
38 |
39 | public void setName(String name) {
40 | this.name = name;
41 | }
42 |
43 | public String getType() {
44 | return type;
45 | }
46 |
47 | public void setType(String type) {
48 | this.type = type;
49 | }
50 |
51 | public boolean isUnique() {
52 | return isUnique;
53 | }
54 |
55 | public void setUnique(boolean isUnique) {
56 | this.isUnique = isUnique;
57 | }
58 |
59 | public String getDefaultValue() {
60 | return defaultValue;
61 | }
62 |
63 | public void setDefaultValue(String defaultValue) {
64 | this.defaultValue = defaultValue;
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/config/Config.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.config;
2 |
3 | import android.content.Context;
4 |
5 | import java.util.Map;
6 |
7 |
8 | /**
9 | * 使用项目需要的配置
10 | * Created by yangyan
11 | * on 2018/3/17.
12 | */
13 |
14 | public class Config {
15 | /**必传参数**/
16 | //是否为BuildConfig.DEBUG,日志输出需要
17 | public static boolean DEBUG;
18 | //设置Context
19 | public static Context CONTEXT;
20 | /**Retrofit**/
21 | //网络请求的域名
22 | public static String URL_DOMAIN;
23 | //网络缓存地址
24 | public static String URL_CACHE;
25 | //设置OkHttp的缓存机制的最大缓存时间,默认为一天
26 | public static long MAX_CACHE_SECONDS= 60 * 60 * 24;
27 | //缓存最大的内存,默认为10M
28 | public static long MAX_MEMORY_SIZE=10 * 1024 * 1024;
29 | //设置网络请求json通用解析类
30 | public static Class MClASS;
31 | public static String EXPOSEPARAM;
32 | /**SharePreference**/
33 | public static String USER_CONFIG="collection_android_library_user_config";
34 |
35 | /***请求接口超时设定**/
36 | public static int CONNECT_TIMEOUT_SECONDS=60;
37 | public static int READ_TIMEOUT_SECONDS=60;
38 | public static int WRITE_TIMEOUT_SECONDS=60;
39 |
40 | /***设置全局请求头***/
41 | public static Map HEADERS;
42 |
43 | /*****数据库设置**/
44 | public static String SQLITE_DB_NAME="collection_android_library.db";
45 | public static int SQLITE_DB_VERSION=0;
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/adapter/MainViewAdapter.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.adapter;
2 |
3 | import android.content.Context;
4 |
5 | import com.youngmanster.collection.R;
6 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseRecyclerViewAdapter;
7 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseViewHolder;
8 | import com.youngmanster.collectionlibrary.refreshrecyclerview.pulltorefresh.PullToRefreshRecyclerView;
9 | import com.youngmanster.collectionlibrary.utils.DisplayUtils;
10 |
11 | import java.util.List;
12 |
13 | /**
14 | * Created by yangyan.
15 | */
16 | public class MainViewAdapter extends BaseRecyclerViewAdapter {
17 |
18 | private int mScreenWidth,mItemWidth;
19 |
20 | public MainViewAdapter(Context context, List datas, PullToRefreshRecyclerView refreshRecyclerView) {
21 | super(context,R.layout.item_main,datas,refreshRecyclerView);
22 | mScreenWidth= DisplayUtils.getScreenWidthPixels(context);
23 | mItemWidth=(mScreenWidth-DisplayUtils.dip2px(context,20))/2;
24 | }
25 |
26 | @Override
27 | protected void convert(BaseViewHolder baseViewHolder, String s) {
28 | baseViewHolder.setText(R.id.title,s);
29 | baseViewHolder.getView(R.id.card_view).getLayoutParams().height=mItemWidth;
30 | baseViewHolder.getView(R.id.card_view).getLayoutParams().width=mItemWidth;
31 | }
32 | }
--------------------------------------------------------------------------------
/collectionlibrary/src/main/res/layout/collection_library_view_loading.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
20 |
26 |
27 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/refreshrecyclerview/base/refreshview/BaseLoadMoreView.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.refreshrecyclerview.base.refreshview;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.view.View;
6 | import android.widget.LinearLayout;
7 |
8 | /**
9 | * 加载更多基类,如果要自定义加载布局只需要继承该基类,在对应的方法中进行逻辑整理
10 | * Created by yangyan
11 | * on 2018/3/9.
12 | */
13 |
14 | public abstract class BaseLoadMoreView extends LinearLayout{
15 |
16 | /***
17 | * 加载更多分为3个状态
18 | */
19 | //正在加载
20 | public final static int STATE_LOADING = 0;
21 | //加载完成
22 | public final static int STATE_COMPLETE = 1;
23 | //没有数据
24 | public final static int STATE_NODATA= 2;
25 |
26 | //初始化状态
27 | public int mState = STATE_COMPLETE;
28 |
29 | public View mContainer;
30 |
31 |
32 | public BaseLoadMoreView(Context context) {
33 | super(context);
34 | LayoutParams lp = new LayoutParams(
35 | RecyclerView.LayoutParams.MATCH_PARENT, RecyclerView.LayoutParams.WRAP_CONTENT);
36 | this.setLayoutParams(lp);
37 | initView(context);
38 | }
39 |
40 | /**
41 | * 状态设置
42 | */
43 | public abstract void initView(Context context);
44 |
45 | /**
46 | * 状态设置
47 | */
48 | public abstract void setState(int state);
49 | /**
50 | * 获取状态
51 | */
52 | public int getState() {
53 | return mState;
54 | }
55 |
56 | /**
57 | * 销毁页面对象和动画,防止内存泄漏
58 | */
59 | public abstract void destroy();
60 | }
61 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/mvp/presenter/WeChatFeaturedNoCommonClassPresenter.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.mvp.presenter;
2 |
3 | import com.youngmanster.collection.been.WeChatNewsResult;
4 | import com.youngmanster.collection.http.ApiUrl;
5 | import com.youngmanster.collection.mvp.view.IWeChatFeaturedNoCommonClassView;
6 | import com.youngmanster.collectionlibrary.data.DataManager;
7 | import com.youngmanster.collectionlibrary.mvp.BasePresenter;
8 | import com.youngmanster.collectionlibrary.network.RequestBuilder;
9 | import com.youngmanster.collectionlibrary.network.rx.RxObservableListener;
10 |
11 | public class WeChatFeaturedNoCommonClassPresenter extends BasePresenter {
12 | public void requestFeaturedNews(int page, int num) {
13 |
14 | RequestBuilder resultRequestBuilder = new RequestBuilder<>(new RxObservableListener() {
15 | @Override
16 | public void onNext(WeChatNewsResult result) {
17 | mView.refreshUI(result.getResult());
18 | }
19 | });
20 |
21 | resultRequestBuilder
22 | .setUrl(ApiUrl.URL_WETCHAT_FEATURED)
23 | .setTransformClass(WeChatNewsResult.class)
24 | .setUseCommonClass(false)
25 | .setParam("page",page)
26 | .setParam("num",num);
27 |
28 | rxManager.addObserver(DataManager.DataForHttp.httpRequest(resultRequestBuilder));
29 |
30 | }
31 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/activity/base/activity/ChangeStatusBarActivity.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.activity.base.activity;
2 |
3 | import android.content.Intent;
4 | import android.view.View;
5 |
6 | import com.youngmanster.collection.R;
7 | import com.youngmanster.collection.base.BaseActivity;
8 |
9 | import butterknife.OnClick;
10 |
11 | /**
12 | * Created by yangyan
13 | * on 2018/5/14.
14 | */
15 |
16 | public class ChangeStatusBarActivity extends BaseActivity {
17 |
18 | private Intent intent;
19 |
20 | @Override
21 | public int getLayoutId() {
22 | return R.layout.activity_change_statusbar;
23 | }
24 |
25 | @Override
26 | public void init() {
27 | defineActionBarConfig.setTitle(getString(R.string.status_bar_title));
28 | }
29 |
30 | @Override
31 | public void requestData() {
32 |
33 | }
34 |
35 | @OnClick({R.id.status_btn1, R.id.status_btn2,R.id.status_btn4})
36 | public void onMenuClick(View view) {
37 | switch (view.getId()) {
38 | case R.id.status_btn1:
39 | intent = new Intent(this, StatusBarColorActivity.class);
40 | intent.putExtra("type",0);
41 | startActivity(intent);
42 | break;
43 | case R.id.status_btn2:
44 | intent = new Intent(this, StatusBarColorActivity.class);
45 | intent.putExtra("type",1);
46 | startActivity(intent);
47 | break;
48 | case R.id.status_btn4:
49 | intent = new Intent(this, TransparentStatusBarActivity.class);
50 | startActivity(intent);
51 | break;
52 | }
53 |
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/popup_slide_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 |
17 |
18 |
23 |
24 |
28 |
29 |
34 |
35 |
39 |
40 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/customview/tagview/layout/FlexDirection.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.customview.tagview.layout;
2 |
3 |
4 | import android.support.annotation.IntDef;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.RetentionPolicy;
8 |
9 | /**
10 | * Created by yangy
11 | * 2020-02-25
12 | * Describe:
13 | */
14 | @IntDef({FlexDirection.ROW, FlexDirection.ROW_REVERSE, FlexDirection.COLUMN,
15 | FlexDirection.COLUMN_REVERSE})
16 | @Retention(RetentionPolicy.SOURCE)
17 | public @interface FlexDirection {
18 |
19 | /**
20 | * Main axis direction -> horizontal. Main start to
21 | * main end -> Left to right (in LTR languages).
22 | * Cross start to cross end -> Top to bottom
23 | */
24 | int ROW = 0;
25 |
26 | /**
27 | * Main axis direction -> horizontal. Main start
28 | * to main end -> Right to left (in LTR languages). Cross start to cross end ->
29 | * Top to bottom.
30 | */
31 | int ROW_REVERSE = 1;
32 |
33 | /**
34 | * Main axis direction -> vertical. Main start
35 | * to main end -> Top to bottom. Cross start to cross end ->
36 | * Left to right (In LTR languages).
37 | */
38 | int COLUMN = 2;
39 |
40 | /**
41 | * Main axis direction -> vertical. Main start
42 | * to main end -> Bottom to top. Cross start to cross end -> Left to right
43 | * (In LTR languages)
44 | */
45 | int COLUMN_REVERSE = 3;
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_popupwindow.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
17 |
18 |
26 |
27 |
35 |
36 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/popup_slide_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
19 |
20 |
24 |
25 |
34 |
35 |
39 |
40 |
49 |
50 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/customview/tagview/layout/AlignContent.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.customview.tagview.layout;
2 |
3 |
4 | import android.support.annotation.IntDef;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.RetentionPolicy;
8 |
9 | /**
10 | * Created by yangy
11 | * 2020-02-25
12 | * Describe:
13 | */
14 | @IntDef({AlignContent.FLEX_START, AlignContent.FLEX_END, AlignContent.CENTER,
15 | AlignContent.SPACE_BETWEEN, AlignContent.SPACE_AROUND, AlignContent.STRETCH})
16 | @Retention(RetentionPolicy.SOURCE)
17 | public @interface AlignContent {
18 |
19 | /** Flex lines are packed to the start of the flex container. */
20 | int FLEX_START = 0;
21 |
22 | /** Flex lines are packed to the end of the flex container. */
23 | int FLEX_END = 1;
24 |
25 | /** Flex lines are centered in the flex container. */
26 | int CENTER = 2;
27 |
28 | /**
29 | * Flex lines are evenly distributed in the flex container. The first flex line is
30 | * placed at the start of the flex container, the last flex line is placed at the
31 | * end of the flex container.
32 | */
33 | int SPACE_BETWEEN = 3;
34 |
35 | /**
36 | * Flex lines are evenly distributed in the flex container with the same amount of spaces
37 | * between the flex lines.
38 | */
39 | int SPACE_AROUND = 4;
40 |
41 | /**
42 | * Flex lines are stretched to fill the remaining space along the cross axis.
43 | */
44 | int STRETCH = 5;
45 | }
46 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/adapter/recyclerview/GoogleRefreshAdapter.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.adapter.recyclerview;
2 |
3 | import android.content.Context;
4 |
5 | import com.youngmanster.collection.R;
6 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseRecyclerViewAdapter;
7 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseViewHolder;
8 | import com.youngmanster.collectionlibrary.refreshrecyclerview.pulltorefresh.PullToRefreshRecyclerView;
9 | import com.youngmanster.collectionlibrary.utils.DisplayUtils;
10 |
11 | import java.util.List;
12 |
13 | /**
14 | * Created by yangyan
15 | * on 2018/3/18.
16 | */
17 |
18 | public class GoogleRefreshAdapter extends BaseRecyclerViewAdapter {
19 |
20 | private int mScreenWidth,mItemWidth;
21 |
22 | public GoogleRefreshAdapter(Context mContext, List mDatas, PullToRefreshRecyclerView pullToRefreshRecyclerView) {
23 | super(mContext, R.layout.item_pull_refresh, mDatas, pullToRefreshRecyclerView);
24 | mScreenWidth= DisplayUtils.getScreenWidthPixels(mContext);
25 | mItemWidth=(mScreenWidth-DisplayUtils.dip2px(mContext,30))/3;
26 | }
27 |
28 | @Override
29 | protected void convert(BaseViewHolder baseViewHolder, String s) {
30 | baseViewHolder.setText(R.id.title,s);
31 | baseViewHolder.getView(R.id.card_view).getLayoutParams().height=mItemWidth;
32 | baseViewHolder.getView(R.id.card_view).getLayoutParams().width=mItemWidth;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/mvp/presenter/WeChatFeaturedPresenter.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.mvp.presenter;
2 |
3 | import com.youngmanster.collection.been.Result;
4 | import com.youngmanster.collection.been.wechat.WeChatNews;
5 | import com.youngmanster.collection.http.ApiUrl;
6 | import com.youngmanster.collection.mvp.view.IWeChatFeaturedView;
7 | import com.youngmanster.collectionlibrary.data.DataManager;
8 | import com.youngmanster.collectionlibrary.mvp.BasePresenter;
9 | import com.youngmanster.collectionlibrary.network.RequestBuilder;
10 | import com.youngmanster.collectionlibrary.network.rx.RxObservableListener;
11 |
12 | import java.util.List;
13 |
14 | public class WeChatFeaturedPresenter extends BasePresenter {
15 |
16 | public void requestFeaturedNews(int page, int num) {
17 |
18 | RequestBuilder>> resultRequestBuilder = new RequestBuilder<>(new RxObservableListener>>() {
19 | @Override
20 | public void onNext(Result> result) {
21 | mView.refreshUI(result.getResult());
22 | }
23 | });
24 |
25 | resultRequestBuilder
26 | .setUrl(ApiUrl.URL_WETCHAT_FEATURED)
27 | .setTransformClass(WeChatNews.class)
28 | .setParam("page",page)
29 | .setParam("type","video")
30 | .setParam("count",num);
31 |
32 |
33 | rxManager.addObserver(DataManager.DataForHttp.httpRequest(resultRequestBuilder));
34 |
35 | }
36 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/adapter/recyclerview/DefaultRecyclerAdapter.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.adapter.recyclerview;
2 |
3 | import android.content.Context;
4 |
5 | import com.youngmanster.collection.R;
6 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseRecyclerViewAdapter;
7 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseViewHolder;
8 | import com.youngmanster.collectionlibrary.refreshrecyclerview.pulltorefresh.PullToRefreshRecyclerView;
9 | import com.youngmanster.collectionlibrary.utils.DisplayUtils;
10 |
11 | import java.util.List;
12 |
13 | /**
14 | * Created by yangyan
15 | * on 2018/3/18.
16 | */
17 |
18 | public class DefaultRecyclerAdapter extends BaseRecyclerViewAdapter {
19 |
20 | private int mScreenWidth,mItemWidth;
21 |
22 | public DefaultRecyclerAdapter(Context mContext, List mDatas, PullToRefreshRecyclerView pullToRefreshRecyclerView) {
23 | super(mContext, R.layout.item_pull_refresh, mDatas, pullToRefreshRecyclerView);
24 | mScreenWidth= DisplayUtils.getScreenWidthPixels(mContext);
25 | mItemWidth=(mScreenWidth-DisplayUtils.dip2px(mContext,30))/3;
26 | }
27 |
28 | @Override
29 | protected void convert(BaseViewHolder baseViewHolder, String s) {
30 | baseViewHolder.setText(R.id.title,s);
31 | baseViewHolder.getView(R.id.card_view).getLayoutParams().height=mItemWidth;
32 | baseViewHolder.getView(R.id.card_view).getLayoutParams().width=mItemWidth;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/customview/activity/TagViewActivity.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.customview.activity;
2 |
3 | import android.view.View;
4 |
5 | import com.youngmanster.collection.R;
6 | import com.youngmanster.collection.base.BaseActivity;
7 | import com.youngmanster.collectionlibrary.customview.tagview.TagView;
8 | import com.youngmanster.collectionlibrary.customview.tagview.TagViewConfigBuilder;
9 | import com.youngmanster.collectionlibrary.utils.ToastUtils;
10 |
11 | import butterknife.BindView;
12 |
13 | /**
14 | * Created by yangy
15 | * 2020-02-28
16 | * Describe:
17 | */
18 | public class TagViewActivity extends BaseActivity {
19 |
20 | @BindView(R.id.tagView)
21 | TagView tagView;
22 |
23 |
24 | @Override
25 | public int getLayoutId() {
26 | return R.layout.activity_tagview;
27 | }
28 |
29 | @Override
30 | public void init() {
31 | defineActionBarConfig.setTitle("TagView");
32 |
33 | String[] list={"werwrw","4545465","金浩","风和日丽",
34 | "一只蜜蜂叮在挂历上","阳光","灿烂","1+1","浏览器","玲珑骰子安红豆,入骨相思知不知"};
35 |
36 | TagViewConfigBuilder builder=new TagViewConfigBuilder()
37 | .setTitles(list);
38 |
39 | tagView.create(builder, new TagView.TagViewPressListener() {
40 | @Override
41 | public void onPress(View view, String title, int position) {
42 | ToastUtils.showToast(TagViewActivity.this,title);
43 | }
44 | });
45 | }
46 |
47 | @Override
48 | public void requestData() {
49 |
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/mvp/ui/wechat/adapter/WeChatFeaturedAdapter.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.mvp.ui.wechat.adapter;
2 |
3 | import android.content.Context;
4 | import android.widget.ImageView;
5 | import com.youngmanster.collection.R;
6 | import com.youngmanster.collection.been.wechat.WeChatNews;
7 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseRecyclerViewAdapter;
8 | import com.youngmanster.collectionlibrary.refreshrecyclerview.base.adapter.BaseViewHolder;
9 | import com.youngmanster.collectionlibrary.refreshrecyclerview.pulltorefresh.PullToRefreshRecyclerView;
10 | import com.youngmanster.collectionlibrary.utils.GlideUtils;
11 |
12 | import java.util.List;
13 |
14 | /**
15 | * Created by yangyan
16 | * on 2018/3/21.
17 | */
18 |
19 | public class WeChatFeaturedAdapter extends BaseRecyclerViewAdapter{
20 |
21 | public WeChatFeaturedAdapter(Context mContext, List mDatas, PullToRefreshRecyclerView pullToRefreshRecyclerView) {
22 | super(mContext, R.layout.item_wechat_featured, mDatas, pullToRefreshRecyclerView);
23 | }
24 |
25 | @Override
26 | protected void convert(BaseViewHolder baseViewHolder, WeChatNews weChatNews) {
27 | baseViewHolder.setText(R.id.weChatTitleTv,weChatNews.getName())
28 | .setText(R.id.weChatNameTv,weChatNews.getText())
29 | .setText(R.id.weChatTimeTv,weChatNews.getPasstime());
30 |
31 | ImageView imageView=baseViewHolder.getView(R.id.weChatIv);
32 | GlideUtils.loadImg(mContext,weChatNews.getThumbnail(),R.mipmap.ic_bttom_loading_01,imageView);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/network/rx/utils/RxAsyncTask.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 xuexiangjys(xuexiangjys@163.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.youngmanster.collectionlibrary.network.rx.utils;
18 |
19 |
20 | /**
21 | * 通用的Rx异步执行任务,在io线程中进行数据处理,在ui线程中刷新ui
22 | */
23 | public abstract class RxAsyncTask implements IRxIOTask, IRxUITask {
24 |
25 | /**
26 | * IO执行任务的入参
27 | */
28 | private T InData;
29 |
30 | /**
31 | * IO执行任务的出参,UI执行任务的入参
32 | */
33 | private R OutData;
34 |
35 | public RxAsyncTask(T inData) {
36 | InData = inData;
37 | }
38 |
39 | public T getInData() {
40 | return InData;
41 | }
42 |
43 | public RxAsyncTask setInData(T inData) {
44 | InData = inData;
45 | return this;
46 | }
47 |
48 | public R getOutData() {
49 | return OutData;
50 | }
51 |
52 | public RxAsyncTask setOutData(R outData) {
53 | OutData = outData;
54 | return this;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_change_statusbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
11 |
12 |
16 |
17 |
25 |
33 |
34 |
35 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/mvp/presenter/WeChatWorldNewsPresenter.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.mvp.presenter;
2 |
3 | import com.youngmanster.collection.been.Result;
4 | import com.youngmanster.collection.been.wechat.WeChatNews;
5 | import com.youngmanster.collection.http.ApiUrl;
6 | import com.youngmanster.collection.mvp.view.IWeChatWorldNewsView;
7 | import com.youngmanster.collectionlibrary.data.DataManager;
8 | import com.youngmanster.collectionlibrary.mvp.BasePresenter;
9 | import com.youngmanster.collectionlibrary.network.RequestBuilder;
10 | import com.youngmanster.collectionlibrary.network.rx.RxObservableListener;
11 |
12 | import java.util.List;
13 |
14 | public class WeChatWorldNewsPresenter extends BasePresenter {
15 | public void requestWorldNews(int page, int num) {
16 |
17 | RequestBuilder>> resultRequestBuilder = new RequestBuilder<>(new RxObservableListener>>() {
18 | @Override
19 | public void onNext(Result> result) {
20 | mView.refreshUI(result.getResult());
21 | }
22 | });
23 |
24 | resultRequestBuilder
25 | .setUrl(ApiUrl.URL_WETCHAT_FEATURED)
26 | .setTransformClass(WeChatNews.class)
27 | .setHttpTypeAndReqType(RequestBuilder.HttpType.DEFAULT_GET, RequestBuilder.ReqType.DEFAULT_CACHE_LIST)
28 | .setParam("page",page)
29 | .setParam("type","video")
30 | .setParam("count",num);
31 |
32 | rxManager.addObserver(DataManager.DataForHttp.httpRequest(resultRequestBuilder));
33 | }
34 | }
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/utils/GetPermissionsUtils.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.utils;
2 |
3 | import android.content.Context;
4 | import android.content.pm.PackageInfo;
5 | import android.content.pm.PackageManager;
6 | import android.content.pm.PermissionGroupInfo;
7 | import android.content.pm.PermissionInfo;
8 |
9 | /**
10 | * Created by yangy
11 | * 2019-09-12
12 | * Describe:
13 | */
14 | public class GetPermissionsUtils {
15 | public static String getAllPermissons(Context context){
16 |
17 | StringBuffer stringBuffer=new StringBuffer();
18 | try {
19 | PackageManager pm = context.getPackageManager();
20 | PackageInfo pi = pm.getPackageInfo(context.getPackageName(), 0);
21 | //得到自己的包名
22 | String pkgName = pi.packageName;
23 |
24 | PermissionGroupInfo pgi;
25 | PackageInfo pkgInfo = pm.getPackageInfo(pkgName, PackageManager.GET_PERMISSIONS);
26 | String sharedPkgList[] = pkgInfo.requestedPermissions;
27 | LogUtils.error("权限",sharedPkgList.length+"");
28 |
29 | for(int i=0;i
2 |
9 |
10 |
15 |
16 |
17 |
24 |
25 |
32 |
33 |
34 |
35 |
36 |
44 |
45 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/activity/base/popupwindow/PopupMenuList.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.activity.base.popupwindow;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.LinearLayoutManager;
5 | import android.support.v7.widget.RecyclerView;
6 | import android.view.ViewGroup;
7 |
8 | import com.youngmanster.collection.R;
9 | import com.youngmanster.collection.activity.base.adapter.PopupMenuListAdapter;
10 | import com.youngmanster.collectionlibrary.base.dialog.BasePopupWindow;
11 |
12 | import java.util.ArrayList;
13 | import java.util.List;
14 |
15 | import butterknife.BindView;
16 | import butterknife.ButterKnife;
17 |
18 | /**
19 | * Created by yangyan
20 | * on 2018/6/7.
21 | */
22 |
23 | public class PopupMenuList extends BasePopupWindow {
24 |
25 | @BindView(R.id.rv)
26 | RecyclerView recyclerView;
27 |
28 |
29 | public PopupMenuList(Context context) {
30 | super(context, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
31 |
32 | ButterKnife.bind(this,popupView);
33 | List list=new ArrayList<>();
34 | for(int i=0;i<5;i++){
35 | list.add("item"+i);
36 | }
37 |
38 | PopupMenuListAdapter popupMenuListAdapter=new PopupMenuListAdapter(context,list);
39 | LinearLayoutManager linearLayoutManager=new LinearLayoutManager(context);
40 | linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
41 | recyclerView.setLayoutManager(linearLayoutManager);
42 | recyclerView.setAdapter(popupMenuListAdapter);
43 | }
44 |
45 | @Override
46 | public int getPopupLayoutRes() {
47 | return R.layout.popup_menu_list;
48 | }
49 |
50 | @Override
51 | public int getPopupAnimationStyleRes() {
52 | return 0;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_definition_animation_loading_more.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
23 |
24 |
31 |
32 |
33 |
34 |
35 |
43 |
44 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/activity/base/activity/TransparentStatusBarActivity.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.activity.base.activity;
2 | import android.view.LayoutInflater;
3 | import android.view.View;
4 | import android.widget.ImageView;
5 |
6 | import com.youngmanster.collection.R;
7 | import com.youngmanster.collection.base.BaseActivity;
8 | import com.youngmanster.collectionlibrary.utils.DisplayUtils;
9 | import com.youngmanster.collectionlibrary.utils.GlideUtils;
10 |
11 | import butterknife.BindView;
12 |
13 | /**
14 | * Created by yangyan
15 | * on 2018/6/6.
16 | */
17 |
18 | public class TransparentStatusBarActivity extends BaseActivity {
19 |
20 | @BindView(R.id.imgBg)
21 | ImageView imgBg;
22 | @BindView(R.id.ivImage)
23 | ImageView ivImage;
24 | @Override
25 | public int getLayoutId() {
26 | return R.layout.activity_transparent_statusbar;
27 | }
28 |
29 | @Override
30 | public void init() {
31 |
32 | DisplayUtils.setStatusBarFullTranslucentWithBlackFont(this);
33 |
34 | // DisplayUtils.setStatusBarFullTranslucent(this);
35 |
36 | GlideUtils.loadImg(this,
37 | "https://gss2.bdstatic.com/9fo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike272%2C5%2C5%2C272%2C90/sign=06f0367c57b5c9ea76fe0bb1b450dd65/d1a20cf431adcbef44627e71a0af2edda3cc9f76.jpg",
38 | R.mipmap.ic_bttom_loading_01,ivImage);
39 |
40 | GlideUtils.loadImgBlur(this,
41 | "https://gss2.bdstatic.com/9fo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike272%2C5%2C5%2C272%2C90/sign=06f0367c57b5c9ea76fe0bb1b450dd65/d1a20cf431adcbef44627e71a0af2edda3cc9f76.jpg",
42 | R.mipmap.ic_bttom_loading_01,imgBg);
43 | }
44 |
45 | @Override
46 | public void requestData() {
47 |
48 | }
49 |
50 | @Override
51 | public boolean isShowCustomActionBar() {
52 | return false;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collection/activity/base/popupwindow/PopupWindowDemoActivity.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection.activity.base.popupwindow;
2 |
3 | import android.content.Intent;
4 | import android.view.View;
5 | import android.widget.Button;
6 |
7 | import com.youngmanster.collection.R;
8 | import com.youngmanster.collection.activity.base.activity.PopupMenuActivity;
9 | import com.youngmanster.collection.base.BaseActivity;
10 |
11 | import butterknife.BindView;
12 | import butterknife.OnClick;
13 |
14 | /**
15 | * Created by yangyan
16 | * on 2018/6/7.
17 | */
18 |
19 | public class PopupWindowDemoActivity extends BaseActivity {
20 |
21 | @BindView(R.id.status_btn2)
22 | Button statusBtn;
23 |
24 | @Override
25 | public int getLayoutId() {
26 | return R.layout.activity_popupwindow;
27 | }
28 |
29 | @Override
30 | public void init() {
31 | defineActionBarConfig.setTitle(getString(R.string.popup_title));
32 | }
33 |
34 | @Override
35 | public void requestData() {
36 |
37 | }
38 |
39 |
40 | @OnClick({R.id.status_btn1, R.id.status_btn2,R.id.status_btn3,R.id.status_btn4})
41 | public void onMenuClick(View view) {
42 | switch (view.getId()) {
43 | case R.id.status_btn1:
44 | PopupSlideBottom popupSlideBottom=new PopupSlideBottom(this);
45 | popupSlideBottom.showPopup();
46 | break;
47 | case R.id.status_btn2:
48 | PopupSlideButton popupSlideButton=new PopupSlideButton(this);
49 | popupSlideButton.showPopupAsDropDown(statusBtn);
50 | break;
51 |
52 | case R.id.status_btn3:
53 | PopupTip popupTip=new PopupTip(this);
54 | popupTip.showPopup();
55 | break;
56 | case R.id.status_btn4:
57 | Intent intent=new Intent(this, PopupMenuActivity.class);
58 | startActivity(intent);
59 | break;
60 | }
61 |
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_click.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
14 |
17 |
18 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/collectionlibrary/src/main/java/com/youngmanster/collectionlibrary/customview/tagview/layout/JustifyContent.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionlibrary.customview.tagview.layout;
2 |
3 |
4 | import android.support.annotation.IntDef;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.RetentionPolicy;
8 |
9 | /**
10 | * Created by yangy
11 | * 2020-02-25
12 | * Describe:
13 | */
14 | @IntDef({JustifyContent.FLEX_START, JustifyContent.FLEX_END, JustifyContent.CENTER,
15 | JustifyContent.SPACE_BETWEEN, JustifyContent.SPACE_AROUND, JustifyContent.SPACE_EVENLY})
16 | @Retention(RetentionPolicy.SOURCE)
17 | public @interface JustifyContent {
18 |
19 | /** Flex items are packed toward the start line. */
20 | int FLEX_START = 0;
21 |
22 | /** Flex items are packed toward the end line. */
23 | int FLEX_END = 1;
24 |
25 | /** Flex items are centered along the flex line where the flex items belong. */
26 | int CENTER = 2;
27 |
28 | /**
29 | * Flex items are evenly distributed along the flex line, first flex item is on the
30 | * start line, the last flex item is on the end line.
31 | */
32 | int SPACE_BETWEEN = 3;
33 |
34 | /**
35 | * Flex items are evenly distributed along the flex line with the same amount of spaces between
36 | * the flex lines.
37 | */
38 | int SPACE_AROUND = 4;
39 |
40 | /**
41 | * Flex items are evenly distributed along the flex line. The difference between
42 | * {@link #SPACE_AROUND} is that all the spaces between items should be the same as the
43 | * space before the first item and after the last item.
44 | * See
45 | * the document on MDN
46 | * for more details.
47 | */
48 | int SPACE_EVENLY = 5;
49 | }
50 |
--------------------------------------------------------------------------------