├── .gitignore
├── .idea
├── codeStyles
│ ├── Project.xml
│ └── codeStyleConfig.xml
├── compiler.xml
├── gradle.xml
├── jarRepositories.xml
├── misc.xml
├── runConfigurations.xml
└── vcs.xml
├── LICENSE
├── README.md
├── app
├── .gitignore
├── build.gradle
├── jacoco.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── youngmanster
│ │ └── collectionkotlin
│ │ └── ExampleInstrumentedTest.kt
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── youngmanster
│ │ └── collectionkotlin
│ │ ├── activity
│ │ ├── MainActivity.kt
│ │ ├── base
│ │ │ ├── BaseUiActivity.kt
│ │ │ ├── DialogActivity.kt
│ │ │ ├── PermissionActivity.kt
│ │ │ └── StateViewActivity.kt
│ │ ├── baseadapter
│ │ │ ├── BaseAdapterActivity.kt
│ │ │ ├── DragAndDeleteActivity.kt
│ │ │ ├── ExpandRecyclerViewActivity.kt
│ │ │ ├── ItemClickActivity.kt
│ │ │ ├── MultipleItemActivity.kt
│ │ │ └── holder
│ │ │ │ ├── DiscountFirstVH.kt
│ │ │ │ ├── DiscountSecondVH.kt
│ │ │ │ ├── ExpandItem.kt
│ │ │ │ └── ExpandItem1.kt
│ │ ├── customview
│ │ │ ├── CommonLayoutStyleFourActivity.kt
│ │ │ ├── CommonLayoutStyleOneActivity.kt
│ │ │ ├── CommonLayoutStyleSevenActivity.kt
│ │ │ ├── CommonLayoutStyleSixActivity.kt
│ │ │ ├── CommonLayoutStyleThreeActivity.kt
│ │ │ ├── CommonLayoutStyleTwoActivity.kt
│ │ │ ├── CommonTaLayoutStyleFiveActivity.kt
│ │ │ ├── CommonTabLayoutActivity.kt
│ │ │ ├── CustomViewActivity.kt
│ │ │ ├── OutSideFrameTabLayoutActivity.kt
│ │ │ ├── OutSideFrameTabLayoutOneActivity.kt
│ │ │ ├── OutSideFrameTabLayoutTwoActivity.kt
│ │ │ ├── TagViewActivity.kt
│ │ │ └── WrapLinearLayoutActivity.kt
│ │ ├── data
│ │ │ ├── DataManagerActivity.kt
│ │ │ ├── dialog
│ │ │ │ └── CustomizeDialog.kt
│ │ │ └── popup
│ │ │ │ ├── PopupMenuActivity.kt
│ │ │ │ ├── PopupMenuList.kt
│ │ │ │ ├── PopupSlideBottom.kt
│ │ │ │ ├── PopupSlideButton.kt
│ │ │ │ ├── PopupTip.kt
│ │ │ │ └── PopupWindowDemoActivity.kt
│ │ ├── download
│ │ │ └── DownFileActivity.kt
│ │ ├── fragment
│ │ │ └── FragmentActivity.kt
│ │ ├── mvp
│ │ │ ├── MVPActivity.kt
│ │ │ ├── WeChatFeaturedActivity.kt
│ │ │ └── WeChatNewsDefinitionActivity.kt
│ │ ├── recyclerview
│ │ │ ├── HeaderAndEmptyViewActivity.kt
│ │ │ ├── NoMoreDateAndAutoRefreshActivity.kt
│ │ │ ├── RecyclerViewActivity.kt
│ │ │ └── RefreshActivity.kt
│ │ └── status
│ │ │ ├── ChangeStatusBarActivity.kt
│ │ │ ├── StatusBarColorActivity.kt
│ │ │ └── TransparentStatusBarActivity.kt
│ │ ├── adapter
│ │ ├── MainViewAdapter.kt
│ │ ├── baseadapter
│ │ │ ├── DragAndDeleteAdapter.kt
│ │ │ ├── ExpandRecyclerAdapter.kt
│ │ │ ├── ItemClickAdapter.kt
│ │ │ └── MultipleAdapter.kt
│ │ ├── customview
│ │ │ └── CustomTabPagerAdapter.kt
│ │ ├── data
│ │ │ ├── ItemRecycleAdapter.kt
│ │ │ └── PopupMenuListAdapter.kt
│ │ ├── mvp
│ │ │ └── WeChatFeaturedAdapter.kt
│ │ └── recyclerview
│ │ │ ├── CollectionFragmentAdapter.kt
│ │ │ ├── DefaultRecyclerAdapter.kt
│ │ │ ├── DefinitionRecyclerAdapter.kt
│ │ │ ├── GoogleRefreshAdapter.kt
│ │ │ └── PullToRecyclerViewAdapter.kt
│ │ ├── base
│ │ ├── BaseActivity.kt
│ │ └── BaseFragment.kt
│ │ ├── bean
│ │ ├── ClickItem.kt
│ │ ├── HttpResult.kt
│ │ ├── MultiItem.kt
│ │ ├── User.kt
│ │ ├── WeChatNews.kt
│ │ └── WeChatNewsResult.kt
│ │ ├── common
│ │ ├── ApiUrl.kt
│ │ ├── AppApplication.kt
│ │ └── AppConfig.kt
│ │ ├── fragment
│ │ ├── customview
│ │ │ └── ChildFragment.kt
│ │ ├── data
│ │ │ ├── FragmentSharePreference.kt
│ │ │ └── FragmentSqlite.kt
│ │ ├── mvp
│ │ │ ├── FragmentChinaNewsDefinition.kt
│ │ │ ├── FragmentWeChatFeaturedCommonClass.kt
│ │ │ ├── FragmentWeChatFeaturedNoCommonClass.kt
│ │ │ └── FragmentWorldNewsDefinition.kt
│ │ ├── recyclerview
│ │ │ ├── FragmentAddHeader.kt
│ │ │ ├── FragmentAutoRefresh.kt
│ │ │ ├── FragmentDefaultRefreshAndLoading.kt
│ │ │ ├── FragmentDefinitionRefreshAndLoading.kt
│ │ │ ├── FragmentEmptyView.kt
│ │ │ ├── FragmentGoogleRefreshAndLoading.kt
│ │ │ └── FragmentNoMoreData.kt
│ │ └── skip
│ │ │ ├── SkipFragment.kt
│ │ │ └── SkipFragment2.kt
│ │ ├── mvp
│ │ ├── presenter
│ │ │ ├── DownloadFilePresenter.kt
│ │ │ ├── WeChatChinaNewsDefinitionPresenter.kt
│ │ │ ├── WeChatFeaturedNoCommonClassPresenter.kt
│ │ │ ├── WeChatFeaturedPresenter.kt
│ │ │ └── WeChatWorldNewsDefinitionPresenter.kt
│ │ └── view
│ │ │ ├── IDownloadFileView.kt
│ │ │ ├── IWeChatChinaNewsDefinitionView.kt
│ │ │ ├── IWeChatFeaturedNoCommonClassView.kt
│ │ │ ├── IWeChatFeaturedView.kt
│ │ │ └── IWeChatWorldNewsDefinitionView.kt
│ │ └── view
│ │ ├── DefinitionAnimationLoadMoreView.kt
│ │ └── DefinitionAnimationRefreshHeaderView.kt
│ ├── res-night
│ └── values
│ │ └── colors.xml
│ └── res
│ ├── anim
│ ├── back_animation_one.xml
│ ├── back_animation_two.xml
│ ├── scale_tip_in.xml
│ ├── scale_tip_out.xml
│ ├── slide_bottom_in.xml
│ ├── slide_bottom_out.xml
│ ├── sun_animation.xml
│ └── wheel_animation.xml
│ ├── drawable-v24
│ └── ic_launcher_foreground.xml
│ ├── drawable
│ ├── ic_launcher_background.xml
│ ├── loading_bottom.xml
│ ├── selector_tab_home.xml
│ └── shape_item_click.xml
│ ├── layout
│ ├── activity_change_statusbar.xml
│ ├── activity_color_statusbar.xml
│ ├── activity_custom_outsideframetablayout_one.xml
│ ├── activity_custom_outsideframetablayout_two.xml
│ ├── activity_custom_tablayout_five.xml
│ ├── activity_custom_tablayout_four.xml
│ ├── activity_custom_tablayout_one.xml
│ ├── activity_custom_tablayout_seven.xml
│ ├── activity_custom_tablayout_six.xml
│ ├── activity_custom_tablayout_three.xml
│ ├── activity_custom_tablayout_two.xml
│ ├── activity_dialog.xml
│ ├── activity_downlaod.xml
│ ├── activity_fragment_skip.xml
│ ├── activity_main.xml
│ ├── activity_permission.xml
│ ├── activity_popup_list.xml
│ ├── activity_popupwindow.xml
│ ├── activity_pull_refresh.xml
│ ├── activity_refresh.xml
│ ├── activity_state_view.xml
│ ├── activity_tagview.xml
│ ├── activity_test.xml
│ ├── activity_transparent_statusbar.xml
│ ├── activity_wechat_featured.xml
│ ├── activity_wrap_linear.xml
│ ├── custom_tab_view.xml
│ ├── dialog_list.xml
│ ├── fragment_addheader_empty.xml
│ ├── fragment_child.xml
│ ├── fragment_default_refresh.xml
│ ├── fragment_google_refresh.xml
│ ├── fragment_nomore_auto.xml
│ ├── fragment_sharepreference.xml
│ ├── fragment_skip.xml
│ ├── fragment_skip2.xml
│ ├── fragment_sqlite.xml
│ ├── fragment_wechat_news.xml
│ ├── fragment_wechat_news1.xml
│ ├── item_click.xml
│ ├── item_img.xml
│ ├── item_layout.xml
│ ├── item_main.xml
│ ├── item_popup.xml
│ ├── item_pull_refresh.xml
│ ├── item_wechat_featured.xml
│ ├── layout_ad_dialog.xml
│ ├── layout_base_adapter_header.xml
│ ├── layout_bottom_up.xml
│ ├── layout_definition_animation_loading_more.xml
│ ├── layout_definition_animation_refresh.xml
│ ├── layout_empty.xml
│ ├── layout_main_header.xml
│ ├── layout_network_header.xml
│ ├── layout_recyclerview.xml
│ ├── layout_state.xml
│ ├── popup_menu_list.xml
│ ├── popup_slide_bottom.xml
│ ├── popup_slide_button.xml
│ ├── popup_tip.xml
│ ├── rv_item_discount_first.xml
│ └── rv_item_discount_second.xml
│ ├── mipmap-anydpi-v26
│ ├── ic_launcher.xml
│ └── ic_launcher_round.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── header.jpg
│ ├── ic_cancel_popup.png
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_back_btn.png
│ ├── ic_baseadapter.png
│ ├── ic_bttom_loading_01.png
│ ├── ic_bttom_loading_02.png
│ ├── ic_launcher.png
│ ├── ic_launcher_round.png
│ ├── icon_network_header.png
│ ├── pull_back.png
│ ├── pull_rider.png
│ ├── pull_sun.png
│ ├── pull_wheel.png
│ ├── tab_home_select.png
│ └── tab_home_unselect.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── collection-kotlin
├── .gitignore
├── build.gradle
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── youngmanster
│ │ └── collection_kotlin
│ │ └── ExampleInstrumentedTest.kt
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ ├── androidx
│ │ │ └── appcompat
│ │ │ │ └── app
│ │ │ │ └── SkinAppCompatDelegateImpl.java
│ │ └── com
│ │ │ └── youngmanster
│ │ │ └── collection_kotlin
│ │ │ ├── base
│ │ │ ├── baseview
│ │ │ │ ├── ICommonActivity.kt
│ │ │ │ ├── ICommonFragment.kt
│ │ │ │ └── ResultCode.java
│ │ │ ├── customview
│ │ │ │ ├── CollectionViewPager.java
│ │ │ │ ├── tablayout
│ │ │ │ │ ├── CommonTabLayout.java
│ │ │ │ │ ├── OnTabSelectListener.java
│ │ │ │ │ └── OutSideFrameTabLayout.java
│ │ │ │ ├── tagview
│ │ │ │ │ ├── TagView.kt
│ │ │ │ │ ├── TagViewConfigBuilder.kt
│ │ │ │ │ └── layout
│ │ │ │ │ │ ├── AlignContent.java
│ │ │ │ │ │ ├── AlignItems.java
│ │ │ │ │ │ ├── AlignSelf.java
│ │ │ │ │ │ ├── FlexContainer.java
│ │ │ │ │ │ ├── FlexDirection.java
│ │ │ │ │ │ ├── FlexItem.java
│ │ │ │ │ │ ├── FlexLine.java
│ │ │ │ │ │ ├── FlexWrap.java
│ │ │ │ │ │ ├── FlexboxHelper.java
│ │ │ │ │ │ ├── FlexboxLayout.java
│ │ │ │ │ │ └── JustifyContent.java
│ │ │ │ └── wraplayout
│ │ │ │ │ └── AutoLineLayout.kt
│ │ │ ├── dialog
│ │ │ │ ├── BaseDialog.kt
│ │ │ │ ├── BaseDialogFragment.kt
│ │ │ │ ├── BasePopupWindow.kt
│ │ │ │ ├── CommonDialog.kt
│ │ │ │ ├── DialogWrapper.kt
│ │ │ │ ├── IDialog.kt
│ │ │ │ ├── NoLeakDialog.java
│ │ │ │ ├── YYBaseDialog.kt
│ │ │ │ ├── YYDialog.kt
│ │ │ │ ├── YYDialogController.kt
│ │ │ │ └── YYDialogsManager.kt
│ │ │ ├── manager
│ │ │ │ └── AppManager.kt
│ │ │ ├── set
│ │ │ │ ├── LinkedMultiValueMap.java
│ │ │ │ └── MultiValueMap.java
│ │ │ └── stateview
│ │ │ │ └── StateView.kt
│ │ │ ├── config
│ │ │ ├── Config.kt
│ │ │ └── moudle
│ │ │ │ ├── IModuleInit.kt
│ │ │ │ ├── ModuleLifecycleConfig.java
│ │ │ │ └── ModuleLifecycleReflexs.java
│ │ │ ├── data
│ │ │ ├── DataManager.kt
│ │ │ ├── MMKVWithLocalData.kt
│ │ │ ├── SharePreference.kt
│ │ │ └── database
│ │ │ │ ├── Column.java
│ │ │ │ ├── ColumnInfo.java
│ │ │ │ ├── DBTransaction.kt
│ │ │ │ ├── DateUtils.kt
│ │ │ │ ├── DbSQLite.kt
│ │ │ │ ├── PagingList.kt
│ │ │ │ ├── ResultSet.kt
│ │ │ │ ├── SQLiteDataBase.kt
│ │ │ │ ├── SQLiteVersionMigrate.kt
│ │ │ │ └── SqlHelper.kt
│ │ │ ├── mvp
│ │ │ ├── BasePresenter.kt
│ │ │ ├── BaseView.kt
│ │ │ ├── ClassGetUtil.kt
│ │ │ ├── IBaseActivity.kt
│ │ │ └── IBaseFragment.kt
│ │ │ ├── mvvm
│ │ │ ├── application
│ │ │ │ └── BaseApplication.kt
│ │ │ ├── base
│ │ │ │ ├── IMVVMBaseActivity.kt
│ │ │ │ └── IMVVMBaseFragment.kt
│ │ │ ├── command
│ │ │ │ ├── BindingAction.kt
│ │ │ │ └── BindingCommand.kt
│ │ │ ├── liveData
│ │ │ │ └── SingleLiveEvent.kt
│ │ │ ├── mode
│ │ │ │ ├── BaseModel.kt
│ │ │ │ └── IModel.kt
│ │ │ ├── view
│ │ │ │ └── ViewAdapter.kt
│ │ │ └── viewmode
│ │ │ │ ├── BaseViewModel.kt
│ │ │ │ └── IBaseViewModel.kt
│ │ │ ├── network
│ │ │ ├── NetWorkCodeException.kt
│ │ │ ├── RequestBuilder.java
│ │ │ ├── RequestManager.java
│ │ │ ├── RequestService.java
│ │ │ ├── RetrofitManager.kt
│ │ │ ├── convert
│ │ │ │ ├── ConvertParamUtils.java
│ │ │ │ ├── GsonUtils.java
│ │ │ │ ├── ParameterizedTypeImpl.java
│ │ │ │ └── SetterExclusionStrategy.java
│ │ │ ├── download
│ │ │ │ ├── DownloadFileHelper.java
│ │ │ │ ├── DownloadInfo.java
│ │ │ │ └── DownloadProgressBody.java
│ │ │ ├── interceptor
│ │ │ │ └── BasicParamsInterceptor.java
│ │ │ ├── progress
│ │ │ │ └── UploadProgressBody.java
│ │ │ ├── request
│ │ │ │ ├── RequestMethod.java
│ │ │ │ └── RequestMethodImpl.java
│ │ │ ├── rx
│ │ │ │ ├── ObservableListener.kt
│ │ │ │ ├── RxManager.kt
│ │ │ │ ├── RxObservableListener.kt
│ │ │ │ ├── RxSchedulers.java
│ │ │ │ ├── RxSubscriber.java
│ │ │ │ └── utils
│ │ │ │ │ ├── BaseSubscriber.java
│ │ │ │ │ ├── IExceptionHandler.java
│ │ │ │ │ ├── IRxIOTask.java
│ │ │ │ │ ├── IRxUITask.java
│ │ │ │ │ ├── RxAsyncTask.java
│ │ │ │ │ ├── RxException.java
│ │ │ │ │ ├── RxExceptionHandler.java
│ │ │ │ │ ├── RxIOTask.java
│ │ │ │ │ ├── RxIteratorTask.java
│ │ │ │ │ ├── RxJavaUtils.java
│ │ │ │ │ ├── RxSchedulerUtils.java
│ │ │ │ │ ├── RxTaskOnSubscribe.java
│ │ │ │ │ ├── RxUITask.java
│ │ │ │ │ ├── SchedulerTransformer.java
│ │ │ │ │ ├── SchedulerType.java
│ │ │ │ │ └── SimpleThrowableAction.java
│ │ │ └── synchronization
│ │ │ │ └── OkHttpUtils.java
│ │ │ ├── permission
│ │ │ └── PermissionManager.java
│ │ │ ├── recyclerview
│ │ │ ├── BaseLoadMoreView.java
│ │ │ ├── BaseMultiItemEntity.kt
│ │ │ ├── BasePullToRefreshView.java
│ │ │ ├── BaseRecycleItemTouchHelper.java
│ │ │ ├── BaseRecyclerViewAdapter.kt
│ │ │ ├── BaseRecyclerViewMultiItemAdapter.kt
│ │ │ ├── BaseViewHolder.java
│ │ │ ├── DefaultArrowRefreshHeaderView.java
│ │ │ ├── DefaultLoadMoreView.java
│ │ │ ├── LoadingTextConfig.kt
│ │ │ ├── PullToRefreshRecyclerView.java
│ │ │ ├── PullToRefreshRecyclerViewUtils.java
│ │ │ └── tree
│ │ │ │ ├── TreeItem.java
│ │ │ │ ├── base
│ │ │ │ ├── BaseMultipleAdapter.java
│ │ │ │ ├── BaseTreeAdapter.java
│ │ │ │ └── Tree.java
│ │ │ │ └── exception
│ │ │ │ └── StopMsgException.java
│ │ │ ├── screenadaptation
│ │ │ ├── CancelAdapt.java
│ │ │ └── Density.java
│ │ │ ├── theme
│ │ │ ├── Inflater
│ │ │ │ ├── SkinAndroidXViewInflater.java
│ │ │ │ ├── SkinAppCompatViewInflater.java
│ │ │ │ ├── SkinCompatDelegate.java
│ │ │ │ ├── SkinCompatViewInflater.java
│ │ │ │ ├── SkinCustomViewInflater.java
│ │ │ │ ├── SkinLayoutInflater.java
│ │ │ │ └── SkinWrapper.java
│ │ │ ├── SkinActivityLifecycle.java
│ │ │ ├── ThemeManager.java
│ │ │ ├── annotation
│ │ │ │ └── Skinable.java
│ │ │ ├── customview
│ │ │ │ ├── SkinOutSideTabLayoutView.java
│ │ │ │ ├── SkinStateView.java
│ │ │ │ └── SkinTabLayoutView.java
│ │ │ ├── exception
│ │ │ │ └── SkinCompatException.java
│ │ │ ├── load
│ │ │ │ ├── SkinBuildInLoader.java
│ │ │ │ └── SkinNoneLoader.java
│ │ │ ├── material
│ │ │ │ ├── SkinMaterialAppBarLayout.java
│ │ │ │ ├── SkinMaterialBottomNavigationView.java
│ │ │ │ ├── SkinMaterialCollapsingToolbarLayout.java
│ │ │ │ ├── SkinMaterialCoordinatorLayout.java
│ │ │ │ ├── SkinMaterialFloatingActionButton.java
│ │ │ │ ├── SkinMaterialNavigationView.java
│ │ │ │ ├── SkinMaterialTabLayout.java
│ │ │ │ ├── SkinMaterialTextInputEditText.java
│ │ │ │ ├── SkinMaterialTextInputLayout.java
│ │ │ │ └── SkinMaterialViewInflater.java
│ │ │ ├── observe
│ │ │ │ ├── SkinObservable.java
│ │ │ │ └── SkinObserver.java
│ │ │ ├── res
│ │ │ │ ├── ColorState.java
│ │ │ │ ├── SkinCompatDrawableManager.java
│ │ │ │ ├── SkinCompatResources.java
│ │ │ │ ├── SkinCompatUserThemeManager.java
│ │ │ │ ├── SkinCompatVectorResources.java
│ │ │ │ └── SkinResources.java
│ │ │ ├── utils
│ │ │ │ ├── ImageUtils.java
│ │ │ │ ├── SkinCompatDrawableUtils.java
│ │ │ │ ├── SkinCompatThemeUtils.java
│ │ │ │ ├── SkinCompatV7ThemeUtils.java
│ │ │ │ ├── SkinCompatVersionUtils.java
│ │ │ │ ├── SkinConstants.java
│ │ │ │ └── Slog.java
│ │ │ └── widget
│ │ │ │ ├── SkinCompatAutoCompleteTextView.java
│ │ │ │ ├── SkinCompatBackgroundHelper.java
│ │ │ │ ├── SkinCompatButton.java
│ │ │ │ ├── SkinCompatCardView.java
│ │ │ │ ├── SkinCompatCheckBox.java
│ │ │ │ ├── SkinCompatCheckedTextView.java
│ │ │ │ ├── SkinCompatCompoundButtonHelper.java
│ │ │ │ ├── SkinCompatEditText.java
│ │ │ │ ├── SkinCompatFrameLayout.java
│ │ │ │ ├── SkinCompatHelper.java
│ │ │ │ ├── SkinCompatImageButton.java
│ │ │ │ ├── SkinCompatImageHelper.java
│ │ │ │ ├── SkinCompatImageView.java
│ │ │ │ ├── SkinCompatLinearLayout.java
│ │ │ │ ├── SkinCompatMultiAutoCompleteTextView.java
│ │ │ │ ├── SkinCompatProgressBar.java
│ │ │ │ ├── SkinCompatProgressBarHelper.java
│ │ │ │ ├── SkinCompatRadioButton.java
│ │ │ │ ├── SkinCompatRadioGroup.java
│ │ │ │ ├── SkinCompatRatingBar.java
│ │ │ │ ├── SkinCompatRelativeLayout.java
│ │ │ │ ├── SkinCompatScrollView.java
│ │ │ │ ├── SkinCompatSeekBar.java
│ │ │ │ ├── SkinCompatSeekBarHelper.java
│ │ │ │ ├── SkinCompatSpinner.java
│ │ │ │ ├── SkinCompatSupportable.java
│ │ │ │ ├── SkinCompatTextHelper.java
│ │ │ │ ├── SkinCompatTextHelperV17.java
│ │ │ │ ├── SkinCompatTextView.java
│ │ │ │ ├── SkinCompatToolbar.java
│ │ │ │ ├── SkinCompatView.java
│ │ │ │ ├── SkinCompatViewGroup.java
│ │ │ │ ├── SkinConstraintLayoutView.java
│ │ │ │ └── SkinNetScrollView.java
│ │ │ └── utils
│ │ │ ├── AreaUtils.java
│ │ │ ├── ColorUtils.java
│ │ │ ├── DisplayUtils.kt
│ │ │ ├── FileUtils.java
│ │ │ ├── GetPermissionsUtils.kt
│ │ │ ├── GlideUtils.kt
│ │ │ ├── LogUtils.java
│ │ │ ├── MatchUtils.kt
│ │ │ ├── NetworkUtils.java
│ │ │ ├── SoftInputUtils.kt
│ │ │ ├── ThreadPoolManager.kt
│ │ │ ├── ToastUtils.kt
│ │ │ └── aes
│ │ │ ├── AESUtil.java
│ │ │ └── Base64.java
│ └── res
│ │ ├── anim
│ │ ├── alpha_in.xml
│ │ ├── alpha_out.xml
│ │ ├── push_left_in.xml
│ │ ├── push_right_out.xml
│ │ ├── slide_left_in.xml
│ │ ├── slide_left_out.xml
│ │ ├── slide_right_in.xml
│ │ └── slide_right_out.xml
│ │ ├── drawable-v21
│ │ └── ripple_bg.xml
│ │ ├── drawable
│ │ ├── btn_assuere_border_bg_nol.xml
│ │ ├── btn_assuere_border_bg_sel.xml
│ │ ├── btn_cancel_border_bg_nol.xml
│ │ ├── btn_cancel_border_bg_sel.xml
│ │ ├── collection_library_selector_tagview.xml
│ │ ├── collection_library_shape_tagview.xml
│ │ ├── collection_library_shape_tagview_slector.xml
│ │ ├── lib_ui_btn_border_bg_nol.xml
│ │ ├── lib_ui_btn_border_bg_sel.xml
│ │ ├── lib_ui_roundlayout.xml
│ │ ├── lib_ui_selector_btn_border_bg.xml
│ │ ├── lift_on_touch.xml
│ │ ├── selector_btn_assuere_border_bg.xml
│ │ └── selector_btn_cancel_border_bg.xml
│ │ ├── layout
│ │ ├── collection_library_default_base_activity.xml
│ │ ├── collection_library_default_base_fragment.xml
│ │ ├── collection_library_default_common_toolbar.xml
│ │ ├── collection_library_design_layout_tab_icon.xml
│ │ ├── collection_library_design_layout_tab_text.xml
│ │ ├── collection_library_dialog_progress.xml
│ │ ├── collection_library_dialog_title_text_two_button.xml
│ │ ├── collection_library_layout_default_arrow_refresh.xml
│ │ ├── collection_library_layout_default_loading_more.xml
│ │ ├── collection_library_view_disconnect.xml
│ │ ├── collection_library_view_empty.xml
│ │ ├── collection_library_view_loading.xml
│ │ └── lib_ui_layout_dialog_default.xml
│ │ ├── mipmap-xhdpi
│ │ ├── collection_library_ic_bttom_loading_01.png
│ │ ├── collection_library_icon_disconnect.png
│ │ ├── collection_library_icon_refresh_arrow.png
│ │ └── ic_launcher_round.png
│ │ ├── values-en
│ │ └── strings.xml
│ │ ├── values-zh-rTW
│ │ └── strings.xml
│ │ ├── values
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── ids.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ │ └── xml
│ │ └── network_security_config.xml
│ └── test
│ └── java
│ └── com
│ └── youngmanster
│ └── collection_kotlin
│ └── ExampleUnitTest.kt
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 |
--------------------------------------------------------------------------------
/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
22 |
23 |
--------------------------------------------------------------------------------
/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 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/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/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 | beta {
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 |
--------------------------------------------------------------------------------
/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/androidTest/java/com/youngmanster/collectionkotlin/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.runner.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("com.youngmanster.collection", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/activity/baseadapter/holder/DiscountFirstVH.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.activity.baseadapter.holder
2 |
3 | import android.view.View
4 | import android.widget.TextView
5 | import androidx.recyclerview.widget.RecyclerView
6 | import com.youngmanster.collectionkotlin.R
7 |
8 | /**
9 | * Created by yangy
10 | *2021/1/8
11 | *Describe:
12 | */
13 | class DiscountFirstVH: RecyclerView.ViewHolder {
14 |
15 | var tvName:TextView?=null
16 |
17 | constructor(itemView: View):super(itemView){
18 | initView()
19 | }
20 |
21 |
22 | private fun initView(){
23 | tvName=itemView.findViewById(R.id.tv_name)
24 | }
25 |
26 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/activity/baseadapter/holder/DiscountSecondVH.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.activity.baseadapter.holder
2 |
3 | import android.view.View
4 | import android.widget.TextView
5 | import androidx.recyclerview.widget.RecyclerView
6 | import com.youngmanster.collectionkotlin.R
7 |
8 | /**
9 | * Created by yangy
10 | *2021/1/8
11 | *Describe:
12 | */
13 | class DiscountSecondVH: RecyclerView.ViewHolder {
14 |
15 | var tvName:TextView?=null
16 |
17 | constructor(itemView: View):super(itemView){
18 | initView()
19 | }
20 |
21 |
22 | private fun initView(){
23 | tvName=itemView.findViewById(R.id.tv_name)
24 | }
25 |
26 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/activity/baseadapter/holder/ExpandItem.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.activity.baseadapter.holder
2 |
3 | import com.youngmanster.collection_kotlin.recyclerview.tree.TreeItem
4 | import java.util.ArrayList
5 |
6 | /**
7 | * Created by yangy
8 | *2021/1/8
9 | *Describe:
10 | */
11 | class ExpandItem:TreeItem() {
12 |
13 |
14 | override fun getLevel(): Int {
15 | return 0
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/activity/baseadapter/holder/ExpandItem1.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.activity.baseadapter.holder
2 |
3 | import com.youngmanster.collection_kotlin.recyclerview.tree.TreeItem
4 | import java.util.ArrayList
5 |
6 | /**
7 | * Created by yangy
8 | *2021/1/8
9 | *Describe:
10 | */
11 | class ExpandItem1:TreeItem() {
12 |
13 | override fun getLevel(): Int {
14 | return 1
15 | }
16 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/activity/customview/WrapLinearLayoutActivity.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.activity.customview
2 |
3 | import com.youngmanster.collection_kotlin.mvp.BasePresenter
4 | import com.youngmanster.collectionkotlin.R
5 | import com.youngmanster.collectionkotlin.base.BaseActivity
6 |
7 | /**
8 | * Created by yangy
9 | *2020-02-23
10 | *Describe:
11 | */
12 |
13 | class WrapLinearLayoutActivity :BaseActivity>(){
14 | override fun getLayoutId(): Int {
15 | return R.layout.activity_wrap_linear
16 | }
17 |
18 | override fun init() {
19 | defineActionBarConfig.setTitle("AutoLineLayout")
20 | }
21 |
22 | override fun requestData() {
23 | }
24 |
25 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/activity/data/popup/PopupMenuActivity.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.activity.data.popup
2 |
3 | import android.view.View
4 | import com.youngmanster.collection_kotlin.mvp.BasePresenter
5 | import com.youngmanster.collectionkotlin.R
6 | import com.youngmanster.collectionkotlin.base.BaseActivity
7 | import kotlinx.android.synthetic.main.activity_popup_list.*
8 |
9 | /**
10 | * Created by yangy
11 | *2020-02-23
12 | *Describe:
13 | */
14 |
15 | class PopupMenuActivity :BaseActivity>(),View.OnClickListener{
16 | override fun getLayoutId(): Int {
17 | return R.layout.activity_popup_list
18 | }
19 |
20 | override fun init() {
21 | defineActionBarConfig.setTitle(getString(R.string.popup_title))
22 |
23 | clickLl.setOnClickListener(this)
24 | }
25 |
26 | override fun requestData() {
27 | }
28 |
29 | override fun onClick(v: View?) {
30 | val popupMenuList = PopupMenuList(this)
31 | popupMenuList.showPopupAsDropDown(clickLl)
32 | }
33 |
34 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/activity/data/popup/PopupSlideBottom.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.activity.data.popup
2 |
3 | import android.content.Context
4 | import com.youngmanster.collection_kotlin.base.dialog.BasePopupWindow
5 | import com.youngmanster.collectionkotlin.R
6 |
7 | /**
8 | * Created by yangy
9 | *2020-02-23
10 | *Describe:
11 | */
12 |
13 | class PopupSlideBottom(context: Context) : BasePopupWindow(context) {
14 | override fun getPopupLayoutRes(): Int {
15 | return R.layout.popup_slide_bottom
16 | }
17 |
18 | override fun getPopupAnimationStyleRes(): Int {
19 | return R.style.animation_bottom
20 | }
21 |
22 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/activity/data/popup/PopupSlideButton.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.activity.data.popup
2 |
3 | import android.content.Context
4 | import android.view.ViewGroup
5 | import com.youngmanster.collection_kotlin.base.dialog.BasePopupWindow
6 | import com.youngmanster.collectionkotlin.R
7 |
8 | /**
9 | * Created by yangy
10 | *2020-02-23
11 | *Describe:
12 | */
13 |
14 | class PopupSlideButton : BasePopupWindow {
15 |
16 | constructor(context: Context):super(context, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT){
17 | setShowMaskView(false)
18 | }
19 |
20 | override fun getPopupLayoutRes(): Int {
21 | return R.layout.popup_slide_button
22 | }
23 |
24 | override fun getPopupAnimationStyleRes(): Int {
25 | return 0
26 | }
27 |
28 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/activity/data/popup/PopupTip.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.activity.data.popup
2 |
3 | import android.content.Context
4 | import android.view.ViewGroup
5 | import com.youngmanster.collection_kotlin.base.dialog.BasePopupWindow
6 | import com.youngmanster.collectionkotlin.R
7 |
8 | /**
9 | * Created by yangy
10 | *2020-02-23
11 | *Describe:
12 | */
13 |
14 | class PopupTip :BasePopupWindow{
15 | override fun getPopupLayoutRes(): Int {
16 | return R.layout.popup_tip
17 | }
18 |
19 | override fun getPopupAnimationStyleRes(): Int {
20 | return R.style.animation_scale
21 | }
22 |
23 | constructor(context:Context):super(context, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT){
24 | setShowMaskView(false)
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/activity/fragment/FragmentActivity.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.activity.fragment
2 |
3 | import com.youngmanster.collection_kotlin.mvp.BasePresenter
4 | import com.youngmanster.collection_kotlin.utils.LogUtils
5 | import com.youngmanster.collectionkotlin.R
6 | import com.youngmanster.collectionkotlin.base.BaseActivity
7 | import com.youngmanster.collectionkotlin.fragment.skip.SkipFragment
8 |
9 | /**
10 | * Created by yangy
11 | *2020/5/21
12 | *Describe:
13 | */
14 | class FragmentActivity:BaseActivity>() {
15 | override fun getLayoutId(): Int {
16 | return R.layout.activity_fragment_skip
17 | }
18 |
19 | override fun init() {
20 | defineActionBarConfig.setTitle("Fragment页面跳转")
21 | startFragment(SkipFragment::class.java)
22 | }
23 |
24 | override fun requestData() {
25 | }
26 |
27 |
28 | override fun fragmentLayoutId(): Int {
29 | return R.id.root
30 | }
31 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/adapter/baseadapter/DragAndDeleteAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.adapter.baseadapter
2 |
3 | import android.content.Context
4 | import androidx.cardview.widget.CardView
5 | import com.youngmanster.collection_kotlin.recyclerview.BaseRecyclerViewAdapter
6 | import com.youngmanster.collection_kotlin.recyclerview.BaseViewHolder
7 | import com.youngmanster.collection_kotlin.utils.DisplayUtils
8 | import com.youngmanster.collectionkotlin.R
9 |
10 | /**
11 | * Created by yangy
12 | *2020-02-22
13 | *Describe:
14 | */
15 | class DragAndDeleteAdapter(mContext: Context, mLayoutResId: Int, mDatas: ArrayList) :
16 | BaseRecyclerViewAdapter(mContext, mLayoutResId, mDatas) {
17 |
18 | private var mHeight: Int=0
19 |
20 | init {
21 | mHeight = DisplayUtils.dip2px(100f)
22 | }
23 |
24 | override fun convert(baseViewHolder: BaseViewHolder, t: String) {
25 | baseViewHolder.setText(R.id.title, t)
26 | baseViewHolder.getView(R.id.card_view).layoutParams.height = mHeight
27 | }
28 |
29 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/adapter/baseadapter/ItemClickAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.adapter.baseadapter
2 |
3 | import android.content.Context
4 | import android.view.View
5 | import android.widget.TextView
6 | import com.youngmanster.collection_kotlin.recyclerview.BaseRecyclerViewAdapter
7 | import com.youngmanster.collection_kotlin.recyclerview.BaseViewHolder
8 | import com.youngmanster.collectionkotlin.R
9 | import com.youngmanster.collectionkotlin.bean.ClickItem
10 |
11 | /**
12 | * Created by yangy
13 | *2020-02-22
14 | *Describe:
15 | */
16 |
17 | class ItemClickAdapter(mContext: Context, mLayoutResId: Int, mDatas: ArrayList,onClickListener: View.OnClickListener) :
18 | BaseRecyclerViewAdapter(mContext, mLayoutResId, mDatas) {
19 |
20 | private var onClickListener: View.OnClickListener?=null
21 |
22 | init {
23 | this.onClickListener = onClickListener
24 | }
25 |
26 | override fun convert(baseViewHolder: BaseViewHolder, t: ClickItem) {
27 | baseViewHolder.setText(R.id.titleTv, t.title)
28 | .setImageResource(R.id.ivImg, t.res)
29 | .setOnClickListener(R.id.clickTv, onClickListener)
30 |
31 | baseViewHolder.getView(R.id.clickTv).visibility = View.VISIBLE
32 | }
33 |
34 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/adapter/customview/CustomTabPagerAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.adapter.customview
2 |
3 | import android.annotation.SuppressLint
4 | import androidx.fragment.app.Fragment
5 | import androidx.fragment.app.FragmentManager
6 | import androidx.fragment.app.FragmentPagerAdapter
7 |
8 | /**
9 | * Created by yangy
10 | *2020-02-23
11 | *Describe:
12 | */
13 |
14 | class CustomTabPagerAdapter:FragmentPagerAdapter{
15 | private var fragmentList: List?=null
16 | private var titleList: List?=null
17 |
18 | @SuppressLint("WrongConstant")
19 | constructor(fm: FragmentManager, fragmentList:List, titleList: ArrayList):super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT){
20 | this.fragmentList = fragmentList
21 | this.titleList=titleList
22 | }
23 |
24 | override fun getCount(): Int {
25 | return fragmentList?.size!!
26 | }
27 |
28 | override fun getItem(position: Int): Fragment {
29 | return fragmentList?.get(position)!!
30 | }
31 |
32 | override fun getPageTitle(position: Int): CharSequence? {
33 | return titleList?.get(position)
34 | }
35 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/adapter/data/ItemRecycleAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.adapter.data
2 |
3 | import android.content.Context
4 | import com.youngmanster.collection_kotlin.recyclerview.BaseRecyclerViewAdapter
5 | import com.youngmanster.collection_kotlin.recyclerview.BaseViewHolder
6 | import com.youngmanster.collectionkotlin.R
7 |
8 | /**
9 | * Created by yangy
10 | *2020-02-23
11 | *Describe:
12 | */
13 |
14 | class ItemRecycleAdapter(mContext: Context, mLayoutResId: Int, mDatas: ArrayList) :
15 | BaseRecyclerViewAdapter(mContext, mLayoutResId, mDatas) {
16 |
17 | override fun convert(baseViewHolder: BaseViewHolder, t: String) {
18 | baseViewHolder.setText(R.id.tv_Label, t)
19 | }
20 |
21 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/adapter/data/PopupMenuListAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.adapter.data
2 |
3 | import android.content.Context
4 | import com.youngmanster.collection_kotlin.recyclerview.BaseRecyclerViewAdapter
5 | import com.youngmanster.collection_kotlin.recyclerview.BaseViewHolder
6 | import com.youngmanster.collectionkotlin.R
7 |
8 | /**
9 | * Created by yangy
10 | *2020-02-23
11 | *Describe:
12 | */
13 |
14 | class PopupMenuListAdapter(mContext: Context, mLayoutResId: Int, mDatas: ArrayList) :
15 | BaseRecyclerViewAdapter(mContext, mLayoutResId, mDatas) {
16 |
17 | override fun convert(baseViewHolder: BaseViewHolder, t: String) {
18 | baseViewHolder.setText(R.id.tvTxt, t)
19 | }
20 |
21 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/adapter/recyclerview/CollectionFragmentAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.adapter.recyclerview
2 |
3 | import android.annotation.SuppressLint
4 | import androidx.fragment.app.Fragment
5 | import androidx.fragment.app.FragmentManager
6 | import androidx.fragment.app.FragmentPagerAdapter
7 |
8 | /**
9 | * Created by yangy
10 | *2020-02-21
11 | *Describe:
12 | */
13 | class CollectionFragmentAdapter:
14 | FragmentPagerAdapter{
15 |
16 | private var fragmentList: List?=null
17 | private var titleList: List?=null
18 |
19 | @SuppressLint("WrongConstant")
20 | constructor(fm: FragmentManager, fragmentList:List, titleList: List):super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT){
21 | this.fragmentList = fragmentList
22 | this.titleList=titleList
23 | }
24 |
25 | override fun getCount(): Int {
26 | return fragmentList?.size!!
27 | }
28 |
29 | override fun getItem(position: Int): Fragment {
30 | return fragmentList?.get(position)!!
31 | }
32 |
33 | override fun getPageTitle(position: Int): CharSequence? {
34 | return titleList?.get(position)
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/adapter/recyclerview/DefinitionRecyclerAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.adapter.recyclerview
2 |
3 | import android.content.Context
4 | import com.youngmanster.collection_kotlin.recyclerview.BaseRecyclerViewAdapter
5 | import com.youngmanster.collection_kotlin.recyclerview.BaseViewHolder
6 | import com.youngmanster.collection_kotlin.recyclerview.PullToRefreshRecyclerView
7 | import com.youngmanster.collectionkotlin.R
8 |
9 | /**
10 | * Created by yangy
11 | *2020-02-21
12 | *Describe:
13 | */
14 |
15 | class DefinitionRecyclerAdapter(
16 | mContext: Context,
17 | mLayoutResId: Int,
18 | mDatas: ArrayList,
19 | pullToRefreshRecyclerView: PullToRefreshRecyclerView
20 | ) : BaseRecyclerViewAdapter(mContext, mLayoutResId, mDatas, pullToRefreshRecyclerView) {
21 |
22 | override fun convert(baseViewHolder: BaseViewHolder, t: String) {
23 | baseViewHolder.setText(R.id.title, t)
24 | }
25 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/adapter/recyclerview/PullToRecyclerViewAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.adapter.recyclerview
2 |
3 | import android.content.Context
4 | import com.youngmanster.collection_kotlin.recyclerview.BaseRecyclerViewAdapter
5 | import com.youngmanster.collectionkotlin.R
6 | import com.youngmanster.collection_kotlin.recyclerview.BaseViewHolder
7 | import com.youngmanster.collection_kotlin.recyclerview.PullToRefreshRecyclerView
8 |
9 | /**
10 | * Created by yangy
11 | *2020-02-21
12 | *Describe:
13 | */
14 |
15 | class PullToRecyclerViewAdapter(
16 | mContext: Context,
17 | mLayoutResId: Int,
18 | mDatas: ArrayList,
19 | pullToRefreshRecyclerView: PullToRefreshRecyclerView
20 | ) : BaseRecyclerViewAdapter(mContext, mLayoutResId, mDatas, pullToRefreshRecyclerView) {
21 |
22 |
23 | override fun convert(baseViewHolder: BaseViewHolder, t: String) {
24 | baseViewHolder.setText(R.id.title, t)
25 | }
26 |
27 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/base/BaseActivity.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.base
2 |
3 | import android.os.Bundle
4 | import android.view.View
5 | import com.youngmanster.collectionkotlin.R
6 |
7 | import com.youngmanster.collection_kotlin.mvp.BasePresenter
8 | import com.youngmanster.collection_kotlin.mvp.IBaseActivity
9 |
10 | /**
11 | * Created by yangy
12 | *2020-02-21
13 | *Describe:
14 | */
15 |
16 | abstract class BaseActivity> : IBaseActivity() {
17 |
18 |
19 | override fun onCreate(savedInstanceState: Bundle?) {
20 | super.onCreate(savedInstanceState)
21 | defineActionBarConfig
22 | .setBarBackground(R.color.colorPrimaryDark)
23 | .setTitleColor(R.color.white)
24 | .setBackIcon(R.mipmap.ic_back_btn)
25 | .setBackClick(View.OnClickListener {
26 | onBackPressed()
27 | })
28 |
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/base/BaseFragment.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.base
2 |
3 | import android.os.Bundle
4 | import com.youngmanster.collection_kotlin.mvp.BasePresenter
5 | import com.youngmanster.collection_kotlin.mvp.IBaseFragment
6 |
7 | /**
8 | * Created by yangy
9 | *2020-02-21
10 | *Describe:
11 | */
12 |
13 | abstract class BaseFragment>: IBaseFragment(){
14 |
15 | override fun onActivityCreated(savedInstanceState: Bundle?) {
16 | super.onActivityCreated(savedInstanceState)
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/bean/ClickItem.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.bean
2 |
3 | /**
4 | * Created by yangy
5 | *2020-02-22
6 | *Describe:
7 | */
8 | class ClickItem{
9 | var title: String? = ""
10 | var res: Int = 0
11 |
12 |
13 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/bean/HttpResult.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.bean
2 |
3 | import java.io.Serializable
4 |
5 | /**
6 | * Created by yangy
7 | *2020-02-20
8 | *Describe:
9 | */
10 |
11 | class HttpResult : Serializable {
12 | var code: Int = 0
13 | var message: String? = null
14 | var result: T? = null
15 | var data: T? = null
16 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/bean/MultiItem.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.bean
2 |
3 | import com.youngmanster.collection_kotlin.recyclerview.BaseMultiItemEntity
4 |
5 | /**
6 | * Created by yangy
7 | *2020-02-22
8 | *Describe:
9 | */
10 |
11 | class MultiItem:BaseMultiItemEntity{
12 |
13 | companion object{
14 | const val TYPE_TEXT = 1
15 | const val TYPE_IMG = 2
16 | const val TYPE_TEXT_IMG = 3
17 | }
18 |
19 | var title: String? = null
20 | var res: Int = 0
21 | var type: Int = 0
22 |
23 | override fun getItemViewType(): Int {
24 | return type
25 | }
26 |
27 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/bean/User.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.bean
2 |
3 | import com.youngmanster.collection_kotlin.data.database.Column
4 |
5 | /**
6 | * Created by yangy
7 | *2020-02-24
8 | *Describe:
9 | */
10 | class User{
11 | @Column(isPrimaryKey = true)
12 | var id:Int=0
13 | var name:String?="你好"
14 | var age:Int?=0
15 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/bean/WeChatNews.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.bean
2 |
3 | /**
4 | * Created by yangy
5 | *2020-02-20
6 | *Describe:
7 | */
8 |
9 | class WeChatNews {
10 | var sid: String? = null
11 | var text: String? = null
12 | var type: String? = null
13 | var thumbnail: String? = null
14 | var video: String? = null
15 | var images: String? = null
16 | var up: String? = null
17 | var down: String? = null
18 | var forward: String? = null
19 | var comment: String? = null
20 | var uid: String? = null
21 | var name: String? = null
22 | var header: String? = null
23 | var top_comments_content: String? = null
24 | var top_comments_voiceuri: String? = null
25 | var top_comments_uid: String? = null
26 | var top_comments_name: String? = null
27 | var top_comments_header: String? = null
28 | var passtime: String? = null
29 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/bean/WeChatNewsResult.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.bean
2 |
3 | /**
4 | * Created by yangy
5 | *2020-02-22
6 | *Describe:
7 | */
8 |
9 | class WeChatNewsResult {
10 | var code: Int = 0
11 | var message: String? = null
12 | var result: List? = null
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/common/ApiUrl.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.common
2 |
3 | /**
4 | * Created by yangy
5 | *2020-02-20
6 | *Describe:
7 | */
8 | class ApiUrl{
9 | companion object{
10 | val URL_WETCHAT_FEATURED = "getJoke"
11 | }
12 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/common/AppConfig.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.common
2 |
3 | import android.content.Context
4 |
5 | /**
6 | * Created by yangy
7 | *2020-02-22
8 | *Describe:
9 | */
10 | class AppConfig{
11 |
12 | companion object{
13 |
14 | fun getStorageDir(context:Context):String{
15 | return context.getExternalFilesDir(null)?.absolutePath + "/Collection_kotlin/"
16 | }
17 |
18 | fun getURLCacheDir(context:Context):String{
19 | return getStorageDir(context)+ "url/cache/"
20 | }
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/fragment/customview/ChildFragment.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.fragment.customview
2 |
3 | import android.os.Bundle
4 | import com.youngmanster.collection_kotlin.mvp.BasePresenter
5 | import com.youngmanster.collectionkotlin.R
6 | import com.youngmanster.collectionkotlin.base.BaseFragment
7 | import kotlinx.android.synthetic.main.fragment_child.*
8 |
9 | /**
10 | * Created by yangy
11 | *2020-02-23
12 | *Describe:
13 | */
14 |
15 | class ChildFragment :BaseFragment>(){
16 |
17 | companion object{
18 | fun newInstance(str: String): ChildFragment {
19 | val childFragment = ChildFragment()
20 | val bundle = Bundle()
21 | bundle.putString("str", str)
22 | childFragment.arguments = bundle
23 | return childFragment
24 | }
25 | }
26 |
27 |
28 | override fun getLayoutId(): Int {
29 | return R.layout.fragment_child
30 | }
31 |
32 | override fun init() {
33 | val bundle = arguments
34 | val str = bundle?.getString("str")
35 | childTv.text = str
36 | }
37 |
38 | override fun requestData() {
39 | }
40 |
41 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/fragment/skip/SkipFragment.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.fragment.skip
2 | import com.youngmanster.collection_kotlin.mvp.BasePresenter
3 | import com.youngmanster.collection_kotlin.utils.LogUtils
4 | import com.youngmanster.collectionkotlin.R
5 | import com.youngmanster.collectionkotlin.base.BaseFragment
6 | import kotlinx.android.synthetic.main.fragment_skip.*
7 |
8 | /**
9 | * Created by yangy
10 | *2020/5/21
11 | *Describe:
12 | */
13 | class SkipFragment:BaseFragment>() {
14 | override fun getLayoutId(): Int {
15 | return R.layout.fragment_skip
16 | }
17 |
18 | override fun init() {
19 | btn1.setOnClickListener{
20 | startFragment(SkipFragment2::class.java)
21 | }
22 |
23 | btn2.setOnClickListener{
24 | startFragment(SkipFragment2::class.java,true)
25 | }
26 | }
27 |
28 | override fun requestData() {
29 | }
30 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/fragment/skip/SkipFragment2.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.fragment.skip
2 |
3 | import com.youngmanster.collection_kotlin.mvp.BasePresenter
4 | import com.youngmanster.collection_kotlin.utils.LogUtils
5 | import com.youngmanster.collectionkotlin.R
6 | import com.youngmanster.collectionkotlin.base.BaseFragment
7 |
8 | /**
9 | * Created by yangy
10 | *2020/5/21
11 | *Describe:
12 | */
13 | class SkipFragment2:BaseFragment>() {
14 | override fun getLayoutId(): Int {
15 | return R.layout.fragment_skip2
16 | }
17 |
18 | override fun init() {
19 | }
20 |
21 | override fun requestData() {
22 |
23 | }
24 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/mvp/view/IDownloadFileView.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.mvp.view
2 |
3 | import com.youngmanster.collection_kotlin.mvp.BaseView
4 |
5 | interface IDownloadFileView :BaseView{
6 | fun updateProgress( progress: Float)
7 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/mvp/view/IWeChatChinaNewsDefinitionView.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.mvp.view
2 |
3 | import com.youngmanster.collection_kotlin.mvp.BaseView
4 | import com.youngmanster.collectionkotlin.bean.WeChatNews
5 |
6 | interface IWeChatChinaNewsDefinitionView :BaseView{
7 | fun refreshUI(weChatNews: List?)
8 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/mvp/view/IWeChatFeaturedNoCommonClassView.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.mvp.view
2 |
3 | import com.youngmanster.collection_kotlin.mvp.BaseView
4 | import com.youngmanster.collectionkotlin.bean.WeChatNews
5 |
6 | interface IWeChatFeaturedNoCommonClassView :BaseView{
7 | fun refreshUI(newsList: List?)
8 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/mvp/view/IWeChatFeaturedView.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.mvp.view
2 |
3 | import com.youngmanster.collection_kotlin.mvp.BaseView
4 | import com.youngmanster.collectionkotlin.bean.WeChatNews
5 |
6 | interface IWeChatFeaturedView :BaseView{
7 | fun refreshUI(newsList: List?)
8 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/youngmanster/collectionkotlin/mvp/view/IWeChatWorldNewsDefinitionView.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collectionkotlin.mvp.view
2 |
3 | import com.youngmanster.collection_kotlin.mvp.BaseView
4 | import com.youngmanster.collectionkotlin.bean.WeChatNews
5 |
6 | interface IWeChatWorldNewsDefinitionView :BaseView{
7 | fun refreshUI(weChatNews: List?)
8 | }
--------------------------------------------------------------------------------
/app/src/main/res-night/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 |
5 |
--------------------------------------------------------------------------------
/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/src/main/res/anim/scale_tip_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/scale_tip_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_bottom_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_bottom_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/sun_animation.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/wheel_animation.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/loading_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_tab_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_item_click.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_color_statusbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_custom_outsideframetablayout_one.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
22 |
23 |
24 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_custom_outsideframetablayout_two.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
28 |
29 |
30 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_custom_tablayout_five.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
22 |
23 |
27 |
28 |
29 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_custom_tablayout_four.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
21 |
22 |
26 |
27 |
28 |
33 |
34 |
--------------------------------------------------------------------------------
/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 |
15 |
16 |
20 |
21 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_custom_tablayout_six.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
23 |
24 |
28 |
29 |
30 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_custom_tablayout_three.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
21 |
22 |
26 |
27 |
28 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_custom_tablayout_two.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
22 |
23 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_downlaod.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
15 |
16 |
23 |
24 |
25 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_fragment_skip.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_permission.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_popup_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
17 |
18 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_pull_refresh.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_refresh.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
18 |
19 |
20 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_state_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_tagview.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_test.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_transparent_statusbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
15 |
23 |
24 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_wechat_featured.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_wrap_linear.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
16 |
17 |
21 |
22 |
23 |
24 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/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/dialog_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
22 |
23 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_addheader_empty.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_child.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_default_refresh.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_google_refresh.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_nomore_auto.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_skip.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
18 |
19 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_skip2.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_wechat_news.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_wechat_news1.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
13 |
14 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_img.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
19 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_main.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
18 |
19 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_popup.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_pull_refresh.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
18 |
19 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_ad_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/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_empty.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
22 |
23 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/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_network_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_recyclerview.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_state.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/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/res/layout/popup_tip.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
13 |
14 |
19 |
20 |
23 |
24 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/rv_item_discount_first.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/rv_item_discount_second.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/header.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-mdpi/header.jpg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_cancel_popup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-mdpi/ic_cancel_popup.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_back_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-xhdpi/ic_back_btn.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_baseadapter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-xhdpi/ic_baseadapter.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_bttom_loading_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/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-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-xhdpi/ic_bttom_loading_02.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/icon_network_header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-xhdpi/icon_network_header.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/pull_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/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-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/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-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/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-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-xhdpi/pull_wheel.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/tab_home_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-xhdpi/tab_home_select.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/tab_home_unselect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-xhdpi/tab_home_unselect.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 | #eeeeee
7 | #eeeeee
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
14 |
15 |
19 |
20 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.3.41'
5 | repositories {
6 | google()
7 | jcenter()
8 |
9 | }
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.5.0'
12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13 | classpath 'com.novoda:bintray-release:0.9.2'
14 | // NOTE: Do not place your application dependencies here; they belong
15 | // in the individual module build.gradle files
16 | }
17 | }
18 |
19 | allprojects {
20 | repositories {
21 | google()
22 | jcenter()
23 |
24 | }
25 | }
26 |
27 | //解决上传jcenter乱码问题
28 | tasks.withType(Javadoc){
29 | options.addStringOption('Xdoclint:none', '-quiet')
30 | options.addStringOption('encoding', 'UTF-8')
31 | }
32 |
33 | //解决报错问题
34 | tasks.withType(Javadoc).all {
35 | enabled = false
36 | }
37 |
38 | task clean(type: Delete) {
39 | delete rootProject.buildDir
40 | }
41 |
--------------------------------------------------------------------------------
/collection-kotlin/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/collection-kotlin/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/collection-kotlin/consumer-rules.pro
--------------------------------------------------------------------------------
/collection-kotlin/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 |
--------------------------------------------------------------------------------
/collection-kotlin/src/androidTest/java/com/youngmanster/collection_kotlin/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("com.youngmanster.collection_kotlin.test", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
9 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/androidx/appcompat/app/SkinAppCompatDelegateImpl.java:
--------------------------------------------------------------------------------
1 | package androidx.appcompat.app;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.app.Activity;
5 |
6 | import androidx.annotation.NonNull;
7 | import androidx.annotation.Nullable;
8 |
9 | import java.lang.ref.WeakReference;
10 | import java.util.Map;
11 | import java.util.WeakHashMap;
12 |
13 | @SuppressLint("RestrictedApi")
14 | public class SkinAppCompatDelegateImpl extends AppCompatDelegateImpl {
15 | private static Map> sDelegateMap = new WeakHashMap<>();
16 |
17 | public static AppCompatDelegate get(Activity activity, AppCompatCallback callback) {
18 | WeakReference delegateRef = sDelegateMap.get(activity);
19 | AppCompatDelegate delegate = (delegateRef == null ? null : delegateRef.get());
20 | if (delegate == null) {
21 | delegate = new SkinAppCompatDelegateImpl(activity, callback);
22 | sDelegateMap.put(activity, new WeakReference<>(delegate));
23 | }
24 | return delegate;
25 | }
26 |
27 | private SkinAppCompatDelegateImpl(@NonNull Activity activity,
28 | @Nullable AppCompatCallback callback) {
29 | super(activity, callback);
30 | }
31 |
32 |
33 | @Override
34 | public void installViewFactory() {
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/base/baseview/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.collection_kotlin.base.baseview;
17 |
18 | import androidx.annotation.IntDef;
19 |
20 | import com.youngmanster.collection_kotlin.mvp.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({ICommonFragment.RESULT_OK, ICommonFragment.RESULT_CANCELED})
29 | @Retention(RetentionPolicy.SOURCE)
30 | public @interface ResultCode {
31 | }
32 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/base/customview/CollectionViewPager.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.base.customview;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.MotionEvent;
6 |
7 | import androidx.viewpager.widget.ViewPager;
8 |
9 | /**
10 | * Created by yangyan
11 | * on 2018/3/18.
12 | */
13 |
14 | public class CollectionViewPager extends ViewPager {
15 |
16 | private boolean scrollable = true;
17 |
18 | public CollectionViewPager(Context context) {
19 | super(context);
20 | }
21 |
22 | public CollectionViewPager(Context context, AttributeSet attrs) {
23 | super(context, attrs);
24 | }
25 |
26 | public void setScrollable(boolean enable) {
27 | scrollable = enable;
28 | }
29 |
30 | @Override
31 | public boolean onInterceptTouchEvent(MotionEvent ev) {
32 | if(scrollable){
33 | return super.onInterceptTouchEvent(ev);
34 | }else{
35 | return false;
36 | }
37 | }
38 |
39 | @Override
40 | public boolean onTouchEvent(MotionEvent ev) {
41 | if(scrollable){
42 | return super.onTouchEvent(ev);
43 | }else{
44 | return false;
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/base/customview/tablayout/OnTabSelectListener.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.base.customview.tablayout;
2 |
3 | public interface OnTabSelectListener {
4 | void onTabSelect(int position);
5 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/base/customview/tagview/layout/AlignItems.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.base.customview.tagview.layout;
2 |
3 | import androidx.annotation.IntDef;
4 |
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 |
8 | /**
9 | * Created by yangy
10 | * 2020-02-25
11 | * Describe:
12 | */
13 | @IntDef({AlignItems.FLEX_START, AlignItems.FLEX_END, AlignItems.CENTER,
14 | AlignItems.BASELINE, AlignItems.STRETCH})
15 | @Retention(RetentionPolicy.SOURCE)
16 | public @interface AlignItems {
17 |
18 | /** Flex item's edge is placed on the cross start line. */
19 | int FLEX_START = 0;
20 |
21 | /** Flex item's edge is placed on the cross end line. */
22 | int FLEX_END = 1;
23 |
24 | /** Flex item's edge is centered along the cross axis. */
25 | int CENTER = 2;
26 |
27 | /** Flex items are aligned based on their text's baselines. */
28 | int BASELINE = 3;
29 |
30 | /** Flex items are stretched to fill the flex line's cross size. */
31 | int STRETCH = 4;
32 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/base/customview/tagview/layout/AlignSelf.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.base.customview.tagview.layout;
2 |
3 | import androidx.annotation.IntDef;
4 |
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 |
8 | /**
9 | * Created by yangy
10 | * 2020-02-25
11 | * Describe:
12 | */
13 | @IntDef({AlignItems.FLEX_START, AlignItems.FLEX_END, AlignItems.CENTER,
14 | AlignItems.BASELINE, AlignItems.STRETCH, AlignSelf.AUTO})
15 | @Retention(RetentionPolicy.SOURCE)
16 | public @interface AlignSelf {
17 |
18 | /**
19 | * The default value for the AlignSelf attribute, which means use the inherit
20 | * the {@link AlignItems} attribute from its parent.
21 | */
22 | int AUTO = -1;
23 |
24 | /** This item's edge is placed on the cross start line. */
25 | int FLEX_START = AlignItems.FLEX_START;
26 |
27 | /** This item's edge is placed on the cross end line. */
28 | int FLEX_END = AlignItems.FLEX_END;
29 |
30 | /** This item's edge is centered along the cross axis. */
31 | int CENTER = AlignItems.CENTER;
32 |
33 | /** This items is aligned based on their text's baselines. */
34 | int BASELINE = AlignItems.BASELINE;
35 |
36 | /** This item is stretched to fill the flex line's cross size. */
37 | int STRETCH = AlignItems.STRETCH;
38 | }
39 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/base/customview/tagview/layout/FlexWrap.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.base.customview.tagview.layout;
2 |
3 | import androidx.annotation.IntDef;
4 |
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 |
8 | /**
9 | * Created by yangy
10 | * 2020-02-25
11 | * Describe:
12 | */
13 | @IntDef({FlexWrap.NOWRAP, FlexWrap.WRAP, FlexWrap.WRAP_REVERSE})
14 | @Retention(RetentionPolicy.SOURCE)
15 | public @interface FlexWrap {
16 |
17 | /** The flex container is single-line. */
18 | int NOWRAP = 0;
19 |
20 | /** The flex container is multi-line. */
21 | int WRAP = 1;
22 |
23 | /**
24 | * The flex container is multi-line. The direction of the
25 | * cross axis is opposed to the direction as the {@link #WRAP}
26 | */
27 | int WRAP_REVERSE = 2;
28 | }
29 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/base/dialog/DialogWrapper.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.base.dialog
2 |
3 | /**
4 | * Created by yangy
5 | *2020/12/14
6 | *Describe:
7 | */
8 | class DialogWrapper {
9 | private var dialog //统一管理dialog的弹出顺序
10 | : YYDialog.Builder? = null
11 |
12 | constructor(dialog: YYDialog.Builder){
13 | this.dialog = dialog
14 | }
15 |
16 |
17 | fun getDialog(): YYDialog.Builder? {
18 | return dialog
19 | }
20 |
21 | fun setDialog(dialog: YYDialog.Builder?) {
22 | this.dialog = dialog
23 | }
24 |
25 |
26 |
27 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/base/dialog/IDialog.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.base.dialog
2 |
3 | import android.content.Context
4 | import android.view.View
5 |
6 | /**
7 | * Created by yangy
8 | *2020/12/14
9 | *Describe:
10 | */
11 | interface IDialog {
12 |
13 | /**
14 | * 弹窗消失
15 | */
16 | fun dismiss()
17 |
18 | /**
19 | * 构造dialog里的View
20 | */
21 | interface OnBuildListener {
22 | /**
23 | * @param dialog IDialog
24 | * @param view Dialog整体View
25 | * @param layoutRes Dialog的布局 如果没有传入 默认是0
26 | */
27 | fun onBuildChildView(dialog: IDialog?, view: View?, layoutRes: Int)
28 | }
29 |
30 | /***
31 | * 点击事件
32 | */
33 | interface OnClickListener {
34 | fun onClick(dialog: IDialog?)
35 | }
36 |
37 | /**
38 | * Dialog消失回调
39 | */
40 | interface OnDismissListener {
41 | /**
42 | * This method will be invoked when the dialog is dismissed.
43 | *
44 | * @param dialog the dialog that was dismissed will be passed into the
45 | * method
46 | */
47 | fun onDismiss(dialog: IDialog?)
48 | }
49 |
50 | fun getContext(): Context?
51 |
52 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/config/moudle/IModuleInit.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.config.moudle
2 |
3 | import android.app.Application
4 |
5 | /**
6 | * author : yangyan
7 | * date : 2021/4/12 11:34 AM
8 | * description :
9 | */
10 | interface IModuleInit {
11 | fun onInitModule(application: Application)
12 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/config/moudle/ModuleLifecycleConfig.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.config.moudle;
2 |
3 | import android.app.Application;
4 | import android.util.Log;
5 |
6 | import io.reactivex.annotations.Nullable;
7 |
8 | /**
9 | * 作为组件生命周期初始化的配置类,通collection-kotlin过反射机制,动态调用每个组件初始化逻辑
10 | */
11 |
12 | public class ModuleLifecycleConfig {
13 | //内部类,在装载该内部类时才会去创建单例对象
14 | private static class SingletonHolder {
15 | public static ModuleLifecycleConfig instance = new ModuleLifecycleConfig();
16 | }
17 |
18 |
19 |
20 | public static ModuleLifecycleConfig getInstance() {
21 | return SingletonHolder.instance;
22 | }
23 |
24 | private ModuleLifecycleConfig() {}
25 |
26 | //初始化组件
27 | public void initModule(@Nullable Application application) {
28 | if(ModuleLifecycleReflexs.initModuleNames!=null){
29 | for (String moduleInitName : ModuleLifecycleReflexs.initModuleNames) {
30 | try {
31 | Class> clazz = Class.forName(moduleInitName);
32 | IModuleInit init = (IModuleInit) clazz.newInstance();
33 | //调用初始化方法
34 | init.onInitModule(application);
35 | } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
36 | }
37 | }
38 | }
39 |
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/config/moudle/ModuleLifecycleReflexs.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.config.moudle;
2 |
3 | /**
4 | * 组件生命周期反射类名管理,在这里注册需要初始化的组件,通过反射动态调用各个组件的初始化方法
5 | * 注意:以下模块中初始化的Module类不能被混淆
6 | */
7 |
8 | public class ModuleLifecycleReflexs {
9 | public static String[] initModuleNames;
10 | }
11 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/data/database/Column.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.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 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/data/database/ColumnInfo.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.data.database;
2 |
3 | /**
4 | * @author Darcy
5 | */
6 | public class ColumnInfo {
7 |
8 | private boolean isPrimaryKey = false;
9 |
10 | private boolean isNull = true;
11 |
12 | private String name;
13 |
14 | private String type;
15 |
16 | private String defaultValue = "null";
17 |
18 | private boolean isUnique = false;
19 |
20 | public boolean isPrimaryKey() {
21 | return isPrimaryKey;
22 | }
23 |
24 | public void setPrimaryKey(boolean isPrimaryKey) {
25 | this.isPrimaryKey = isPrimaryKey;
26 | }
27 |
28 | public boolean isNull() {
29 | return isNull;
30 | }
31 |
32 | public void setNull(boolean isNull) {
33 | this.isNull = isNull;
34 | }
35 |
36 | public String getName() {
37 | return name;
38 | }
39 |
40 | public void setName(String name) {
41 | this.name = name;
42 | }
43 |
44 | public String getType() {
45 | return type;
46 | }
47 |
48 | public void setType(String type) {
49 | this.type = type;
50 | }
51 |
52 | public boolean isUnique() {
53 | return isUnique;
54 | }
55 |
56 | public void setUnique(boolean isUnique) {
57 | this.isUnique = isUnique;
58 | }
59 |
60 | public String getDefaultValue() {
61 | return defaultValue;
62 | }
63 |
64 | public void setDefaultValue(String defaultValue) {
65 | this.defaultValue = defaultValue;
66 | }
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/data/database/DBTransaction.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.data.database
2 |
3 | /**
4 | * Created by yangy
5 | *2020-02-24
6 | *Describe:
7 | */
8 |
9 | class DBTransaction {
10 | interface DBTransactionInterface {
11 | fun onTransact()
12 | }
13 |
14 | companion object{
15 | /**
16 | * executes sqls in a transction
17 | */
18 | fun transact(db: DbSQLite, transctionInterface: DBTransactionInterface?) {
19 | if (transctionInterface != null) {
20 | val sqliteDb = db.getSQLiteDatabase()
21 | sqliteDb?.beginTransaction()
22 | try {
23 | transctionInterface.onTransact()
24 | sqliteDb?.setTransactionSuccessful()
25 | }catch (e:Exception){
26 | } finally {
27 | sqliteDb?.endTransaction()
28 | }
29 | }
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/data/database/DateUtils.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.data.database
2 |
3 | import java.text.ParseException
4 | import java.text.SimpleDateFormat
5 | import java.util.*
6 |
7 | /**
8 | * Created by yangy
9 | *2020-02-24
10 | *Describe:
11 | */
12 |
13 | class DateUtils {
14 |
15 | companion object{
16 | private val DF_SSS = SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.getDefault())
17 | private val DF = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
18 |
19 |
20 | fun parseStr2Date(str: String): Date? {
21 | try {
22 | return if (str.endsWith(".SSS")) {
23 | DF_SSS.parse(str)
24 | } else {
25 | DF.parse(str)
26 | }
27 | } catch (e: ParseException) {
28 | e.printStackTrace()
29 | return null
30 | }
31 |
32 | }
33 |
34 | fun formatDate2Str(date: Date): String {
35 | return DF_SSS.format(date)
36 | }
37 | }
38 |
39 |
40 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/data/database/PagingList.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.data.database
2 |
3 | /**
4 | * Created by yangy
5 | *2020-02-24
6 | *Describe:
7 | */
8 | class PagingList:ArrayList(){
9 |
10 | private val serialVersionUID = 5526933443772285251L
11 |
12 | private var mTotalSize: Int = 0
13 |
14 | /**
15 | * return total size of your query condition
16 | * @return
17 | */
18 | fun getTotalSize(): Int {
19 | return mTotalSize
20 | }
21 |
22 | /**
23 | * return size of this paing query
24 | */
25 |
26 | internal fun setTotalSize(totalSize: Int) {
27 | this.mTotalSize = totalSize
28 | }
29 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/data/database/SQLiteVersionMigrate.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.data.database
2 |
3 | import com.youngmanster.collection_kotlin.config.Config
4 | import com.youngmanster.collection_kotlin.data.DataManager
5 |
6 | /**
7 | * Created by yangy
8 | *2020-02-24
9 | *Describe:
10 | */
11 |
12 | class SQLiteVersionMigrate {
13 |
14 | interface MigrateListener {
15 | fun onMigrate(oldVersion: Int, newVersion: Int)
16 | }
17 |
18 | fun setMigrateListener(migrate: MigrateListener) {
19 |
20 | val tableVersion = DataManager.DataForSharePreferences.getObject(
21 | SqlHelper.PREFS_TABLE_VERSION_KEY,
22 | 0
23 | )
24 |
25 | if (Config.SQLITE_DB_VERSION > tableVersion!!) {
26 | migrate.onMigrate(tableVersion, Config.SQLITE_DB_VERSION)
27 | }
28 |
29 | DataManager.DataForSharePreferences.saveObject(SqlHelper.PREFS_TABLE_VERSION_KEY,Config.SQLITE_DB_VERSION)
30 | }
31 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/mvp/BasePresenter.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.mvp
2 | import com.youngmanster.collection_kotlin.network.rx.RxManager
3 | import com.youngmanster.collection_kotlin.utils.LogUtils
4 |
5 | /**
6 | * Created by yangy
7 | *2020-02-20
8 | *Describe:
9 | */
10 | @Suppress("UNCHECKED_CAST")
11 | abstract class BasePresenter{
12 | var mView: T?=null
13 | var rxManager: RxManager= RxManager()
14 |
15 | fun setV(v: Any){
16 | this.mView=v as T
17 | }
18 |
19 | fun onDestroy(){
20 | this.mView=null
21 | rxManager.clear()
22 | }
23 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/mvp/BaseView.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.mvp
2 |
3 | /**
4 | * Created by yangy
5 | *2020-02-20
6 | *Describe:
7 | */
8 |
9 | interface BaseView {
10 | fun onError(errorMsg: String)
11 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/mvp/ClassGetUtil.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.mvp
2 |
3 | import java.lang.NullPointerException
4 | import java.lang.reflect.ParameterizedType
5 |
6 | /**
7 | * Created by yangy
8 | *2020-02-20
9 | *Describe:
10 | */
11 | @Suppress("UNCHECKED_CAST")
12 | class ClassGetUtil{
13 | companion object{
14 | fun getClass(o: Any, i: Int): T? {
15 | try {
16 | return ((o.javaClass
17 | .genericSuperclass as ParameterizedType).actualTypeArguments[i] as? Class)!!
18 | .newInstance()
19 | } catch (e: Exception) {
20 | }
21 |
22 | return null
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/mvp/IBaseActivity.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.mvp
2 | import android.content.Intent
3 | import android.os.Bundle
4 | import com.youngmanster.collection_kotlin.base.baseview.ICommonActivity
5 |
6 | /**
7 | * Created by yangy
8 | *2020-02-20
9 | *Describe:
10 | */
11 |
12 | @Suppress("UNCHECKED_CAST")
13 | abstract class IBaseActivity> : ICommonActivity() {
14 |
15 | var mPresenter: T? = null
16 |
17 | override fun onCreate(savedInstanceState: Bundle?) {
18 | super.onCreate(savedInstanceState)
19 | mPresenter = ClassGetUtil.getClass(this, 0)
20 | mPresenter?.setV(this)
21 | }
22 |
23 |
24 | override fun onDestroy() {
25 | super.onDestroy()
26 | mPresenter?.onDestroy()
27 | }
28 |
29 |
30 | fun startAc(claz: Class) {
31 | val intent = Intent()
32 | intent.setClass(this, claz)
33 | startActivity(intent)
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/mvp/IBaseFragment.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.mvp
2 |
3 | import android.os.Bundle
4 | import androidx.fragment.app.Fragment
5 | import com.youngmanster.collection_kotlin.base.baseview.ICommonFragment
6 |
7 |
8 | /**
9 | * Created by yangy
10 | *2020-02-21
11 | *Describe:
12 | */
13 |
14 | abstract class IBaseFragment>: ICommonFragment(){
15 |
16 | var mPresenter: T? = null
17 |
18 |
19 | override fun onCreate(savedInstanceState: Bundle?) {
20 | super.onCreate(savedInstanceState)
21 | mPresenter = ClassGetUtil.getClass(this, 0)
22 | mPresenter?.setV(this)
23 | }
24 |
25 |
26 | override fun onDestroyView() {
27 | super.onDestroyView()
28 | mPresenter?.onDestroy()
29 | }
30 |
31 |
32 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/mvvm/command/BindingAction.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.mvvm.command
2 |
3 | /**
4 | * author : yangyan
5 | * date : 2021/4/8 9:24 AM
6 | * description :
7 | */
8 | interface BindingAction {
9 | fun call()
10 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/mvvm/command/BindingCommand.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.mvvm.command
2 |
3 | /**
4 | * author : yangyan
5 | * date : 2021/4/8 9:23 AM
6 | * description :
7 | */
8 | open class BindingCommand {
9 | private var execute: BindingAction? = null
10 |
11 | constructor(execute: BindingAction) {
12 | this.execute = execute
13 | }
14 |
15 |
16 | /**
17 | * 执行BindingAction命令
18 | */
19 | open fun execute() {
20 | if (execute != null) {
21 | execute!!.call()
22 | }
23 | }
24 |
25 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/mvvm/mode/BaseModel.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.mvvm.mode
2 |
3 | /**
4 | * Created by yangy
5 | *2021/3/29
6 | *Describe:
7 | */
8 | open class BaseModel : IModel {
9 |
10 | /**
11 | * ViewModel销毁时清除Model,与ViewModel共消亡。Model层同样不能持有长生命周期对象
12 | */
13 | override fun onCleared() {
14 | }
15 |
16 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/mvvm/mode/IModel.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.mvvm.mode
2 |
3 | /**
4 | * Created by yangy
5 | *2021/3/29
6 | *Describe:
7 | */
8 | interface IModel {
9 | /**
10 | * ViewModel销毁时清除Model,与ViewModel共消亡。Model层同样不能持有长生命周期对象
11 | */
12 | fun onCleared()
13 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/mvvm/viewmode/IBaseViewModel.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.mvvm.viewmode
2 |
3 | import androidx.lifecycle.Lifecycle
4 | import androidx.lifecycle.LifecycleObserver
5 | import androidx.lifecycle.LifecycleOwner
6 | import androidx.lifecycle.OnLifecycleEvent
7 |
8 | /**
9 | * Created by yangy
10 | *2021/3/29
11 | *Describe:
12 | */
13 | interface IBaseViewModel: LifecycleObserver {
14 | @OnLifecycleEvent(Lifecycle.Event.ON_ANY)
15 | fun onAny(owner: LifecycleOwner?, event: Lifecycle.Event?)
16 |
17 | @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
18 | fun onCreate()
19 |
20 | @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
21 | fun onDestroy()
22 |
23 | @OnLifecycleEvent(Lifecycle.Event.ON_START)
24 | fun onStart()
25 |
26 | @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
27 | fun onStop()
28 |
29 | @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
30 | fun onResume()
31 |
32 | @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
33 | fun onPause()
34 |
35 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/network/RequestManager.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.network;
2 | import com.youngmanster.collection_kotlin.network.request.RequestMethodImpl;
3 | import com.youngmanster.collection_kotlin.network.synchronization.OkHttpUtils;
4 | import io.reactivex.observers.DisposableObserver;
5 | import okhttp3.ResponseBody;
6 |
7 | /**
8 | * 请求管理
9 | * Created by yangyan
10 | * on 2018/3/23.
11 | */
12 |
13 | public class RequestManager {
14 |
15 | private RequestMethodImpl requestMethod;
16 |
17 | private static class SingletonHolder{
18 | private static final RequestManager INSTANCE = new RequestManager();
19 | }
20 |
21 | public static RequestManager getInstance() {
22 | return SingletonHolder.INSTANCE;
23 | }
24 |
25 | private RequestManager() {
26 | requestMethod=new RequestMethodImpl();
27 | }
28 |
29 | public DisposableObserver request(RequestBuilder builder) {
30 | if (builder.getReqMode() == RequestBuilder.ReqMode.ASYNCHRONOUS) {
31 | return requestMethod.request(builder);
32 | } else {
33 | try {
34 | OkHttpUtils.requestSyncData(builder);
35 | }catch (Exception e){
36 |
37 | }
38 |
39 | }
40 | return null;
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/network/convert/ParameterizedTypeImpl.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.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 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/network/convert/SetterExclusionStrategy.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.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 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/network/rx/ObservableListener.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.network.rx
2 |
3 | import com.youngmanster.collection_kotlin.network.NetWorkCodeException
4 |
5 | /**
6 | * Created by yangy
7 | *2020-02-20
8 | *Describe:
9 | */
10 |
11 | interface ObservableListener {
12 | fun onNext(result: T)
13 | fun onError(e: NetWorkCodeException.ResponseThrowable)
14 | fun onDownloadProgress(total:Long,currentLength:Long,progress:Float)
15 | fun onUploadProgress(total: Long,progress: Float)
16 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/network/rx/RxManager.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.network.rx
2 |
3 | import com.youngmanster.collection_kotlin.utils.LogUtils
4 | import io.reactivex.disposables.CompositeDisposable
5 | import io.reactivex.disposables.Disposable
6 | import io.reactivex.observers.DisposableObserver
7 | import okhttp3.ResponseBody
8 |
9 | /**
10 | * Created by yangy
11 | *2020-02-20
12 | *Describe:
13 | */
14 |
15 | class RxManager{
16 | private val compositeDisposable = CompositeDisposable()
17 |
18 | /**
19 | * 添加observer
20 | * @param observer
21 | */
22 | fun addObserver(observer: DisposableObserver?){
23 | if(observer != null){
24 | compositeDisposable.add(observer)
25 | }
26 |
27 | }
28 |
29 | /**
30 | * 添加observer
31 | * @param observer
32 | */
33 | fun addObserver(disposable: Disposable?){
34 | if(disposable != null){
35 | compositeDisposable.add(disposable)
36 | }
37 |
38 | }
39 |
40 | fun clear(){
41 | compositeDisposable.clear()
42 | }
43 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/network/rx/RxObservableListener.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.network.rx
2 | import com.youngmanster.collection_kotlin.network.NetWorkCodeException
3 |
4 | /**
5 | * Created by yangy
6 | *2020-02-20
7 | *Describe:
8 | */
9 |
10 | abstract class RxObservableListener : ObservableListener {
11 |
12 | private var mErrorMsg: String? = null
13 |
14 | protected constructor(){
15 | }
16 |
17 |
18 |
19 | override fun onDownloadProgress(total: Long, currentLength:Long,progress: Float) {
20 | }
21 |
22 | override fun onUploadProgress(total: Long, progress: Float) {
23 | }
24 |
25 |
26 | override fun onError(e: NetWorkCodeException.ResponseThrowable) {
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/network/rx/RxSchedulers.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.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 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/network/rx/RxSubscriber.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.network.rx;
2 |
3 |
4 | import com.youngmanster.collection_kotlin.network.NetWorkCodeException;
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.Companion.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 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/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.collection_kotlin.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 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/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.collection_kotlin.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 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/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.collection_kotlin.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 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/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.collection_kotlin.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 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/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.collection_kotlin.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 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/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.collection_kotlin.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 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/network/rx/utils/SchedulerType.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.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 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/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.collection_kotlin.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 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/recyclerview/BaseLoadMoreView.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.recyclerview;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 | import android.widget.LinearLayout;
6 |
7 | import androidx.recyclerview.widget.RecyclerView;
8 |
9 | /**
10 | * 加载更多基类,如果要自定义加载布局只需要继承该基类,在对应的方法中进行逻辑整理
11 | * Created by yangyan
12 | * on 2018/3/9.
13 | */
14 |
15 | public abstract class BaseLoadMoreView extends LinearLayout {
16 |
17 | /***
18 | * 加载更多分为3个状态
19 | */
20 | //正在加载
21 | public final static int STATE_LOADING = 0;
22 | //加载完成
23 | public final static int STATE_COMPLETE = 1;
24 | //没有数据
25 | public final static int STATE_NODATA= 2;
26 |
27 | //初始化状态
28 | public int mState = STATE_COMPLETE;
29 |
30 | public View mContainer;
31 |
32 |
33 | public BaseLoadMoreView(Context context) {
34 | super(context);
35 | LayoutParams lp = new LayoutParams(
36 | RecyclerView.LayoutParams.MATCH_PARENT, RecyclerView.LayoutParams.WRAP_CONTENT);
37 | this.setLayoutParams(lp);
38 | initView(context);
39 | }
40 |
41 | /**
42 | * 状态设置
43 | */
44 | public abstract void initView(Context context);
45 |
46 | /**
47 | * 状态设置
48 | */
49 | public abstract void setState(int state);
50 | /**
51 | * 获取状态
52 | */
53 | public int getState() {
54 | return mState;
55 | }
56 |
57 | /**
58 | * 销毁页面对象和动画,防止内存泄漏
59 | */
60 | public abstract void destroy();
61 | }
62 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/recyclerview/BaseMultiItemEntity.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.recyclerview
2 |
3 | /**
4 | * Created by yangy
5 | *2020-02-22
6 | *Describe:
7 | */
8 | interface BaseMultiItemEntity{
9 | fun getItemViewType(): Int
10 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/recyclerview/tree/TreeItem.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.recyclerview.tree;
2 |
3 | import com.youngmanster.collection_kotlin.recyclerview.tree.base.Tree;
4 |
5 | import java.util.ArrayList;
6 |
7 | /**
8 | * @author: yangyan
9 | */
10 | public abstract class TreeItem implements Tree {
11 |
12 | private ArrayList children;
13 |
14 | private boolean isOpen;
15 |
16 | public final boolean isOpen() {
17 | return isOpen;
18 | }
19 |
20 | public final void setOpen(boolean open) {
21 | isOpen = open;
22 | }
23 |
24 | @Override
25 | public final boolean isExpand() {
26 | return isOpen;
27 | }
28 |
29 |
30 | @Override
31 | public ArrayList getChildren() {
32 | return children;
33 | }
34 |
35 | public void setChildren(ArrayList children){
36 | this.children=children;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/recyclerview/tree/base/BaseMultipleAdapter.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.recyclerview.tree.base;
2 |
3 | import androidx.recyclerview.widget.RecyclerView;
4 |
5 | import com.youngmanster.collection_kotlin.recyclerview.tree.TreeItem;
6 |
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 | /**
11 | * @author: yangyan
12 | */
13 | public abstract class BaseMultipleAdapter extends RecyclerView.Adapter {
14 |
15 | List mDatas = new ArrayList<>();
16 |
17 | @Override
18 | public int getItemCount() {
19 | return mDatas != null ? mDatas.size() : 0;
20 | }
21 |
22 | public void addMoreDatas(List info) {
23 | if (info != null && info.size() > 0) {
24 | mDatas.addAll(mDatas.size(), info);
25 | notifyItemRangeInserted(mDatas.size(), info.size());
26 | }
27 | }
28 |
29 | public List getDatas() {
30 | return mDatas;
31 | }
32 |
33 | public void setDatas(ArrayList info) {
34 | if (info != null) {
35 | mDatas = info;
36 | } else {
37 | mDatas.clear();
38 | }
39 | notifyDataSetChanged();
40 | }
41 |
42 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/recyclerview/tree/base/Tree.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.recyclerview.tree.base;
2 |
3 | import java.util.ArrayList;
4 |
5 | /**
6 | * @author: yangyan
7 | */
8 | public interface Tree {
9 |
10 | int getLevel();
11 |
12 | ArrayList getChildren();
13 |
14 | boolean isExpand();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/recyclerview/tree/exception/StopMsgException.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.recyclerview.tree.exception;
2 |
3 |
4 | import com.youngmanster.collection_kotlin.recyclerview.tree.base.Tree;
5 |
6 | /**
7 | * @author: WelliJohn
8 | * @time: 2018/8/6-17:12
9 | * @email: wellijohn1991@gmail.com
10 | * @desc: 递归跳出的异常
11 | */
12 | public class StopMsgException extends RuntimeException {
13 | private Tree tree;
14 |
15 | public T getTree() {
16 | return (T) tree;
17 | }
18 |
19 | public StopMsgException setTree(Tree tree) {
20 | this.tree = tree;
21 | return this;
22 | }
23 |
24 | public StopMsgException(String message) {
25 | super(message);
26 | }
27 |
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/screenadaptation/CancelAdapt.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 JessYan
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.collection_kotlin.screenadaptation;
17 |
18 | import android.app.Activity;
19 |
20 | /**
21 | * ================================================
22 | * AndroidAutoSize 默认项目中的所有模块都使用适配功能, 三方库的 {@link Activity} 也不例外
23 | * 如果某个页面不想使用适配功能, 请让该页面 {@link Activity} 实现此接口
24 | * 实现此接口表示放弃适配, 所有的适配效果都将失效
25 | * ================================================
26 | */
27 | public interface CancelAdapt {
28 | }
29 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/Inflater/SkinLayoutInflater.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.Inflater;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.View;
6 |
7 | import androidx.annotation.NonNull;
8 |
9 |
10 | public interface SkinLayoutInflater {
11 | View createView(@NonNull Context context, final String name, @NonNull AttributeSet attrs);
12 | }
13 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/Inflater/SkinWrapper.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.Inflater;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.View;
6 |
7 | public interface SkinWrapper {
8 | Context wrapContext(Context context, View parent, AttributeSet attrs);
9 | }
10 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/annotation/Skinable.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.annotation;
2 |
3 | import java.lang.annotation.Retention;
4 | import java.lang.annotation.Target;
5 |
6 | import static java.lang.annotation.ElementType.TYPE;
7 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
8 |
9 | @Retention(RUNTIME)
10 | @Target({TYPE})
11 | public @interface Skinable {
12 | }
13 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/exception/SkinCompatException.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.exception;
2 |
3 | public class SkinCompatException extends RuntimeException {
4 | public SkinCompatException(String message) {
5 | super(message);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/load/SkinNoneLoader.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.load;
2 |
3 | import android.content.Context;
4 | import android.content.res.ColorStateList;
5 | import android.graphics.drawable.Drawable;
6 |
7 | import com.youngmanster.collection_kotlin.theme.ThemeManager;
8 |
9 |
10 | public class SkinNoneLoader implements ThemeManager.SkinLoaderStrategy {
11 | @Override
12 | public String loadSkinInBackground(Context context, String skinName) {
13 | return "";
14 | }
15 |
16 | @Override
17 | public String getTargetResourceEntryName(Context context, String skinName, int resId) {
18 | return "";
19 | }
20 |
21 | @Override
22 | public ColorStateList getColor(Context context, String skinName, int resId) {
23 | return null;
24 | }
25 |
26 | @Override
27 | public ColorStateList getColorStateList(Context context, String skinName, int resId) {
28 | return null;
29 | }
30 |
31 | @Override
32 | public Drawable getDrawable(Context context, String skinName, int resId) {
33 | return null;
34 | }
35 |
36 | @Override
37 | public int getType() {
38 | return ThemeManager.SKIN_LOADER_STRATEGY_NONE;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/material/SkinMaterialAppBarLayout.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.material;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 |
6 | import com.google.android.material.appbar.AppBarLayout;
7 | import com.youngmanster.collection_kotlin.theme.widget.SkinCompatBackgroundHelper;
8 | import com.youngmanster.collection_kotlin.theme.widget.SkinCompatSupportable;
9 |
10 |
11 | public class SkinMaterialAppBarLayout extends AppBarLayout implements SkinCompatSupportable {
12 | private SkinCompatBackgroundHelper mBackgroundTintHelper;
13 |
14 | public SkinMaterialAppBarLayout(Context context) {
15 | this(context, null);
16 | }
17 |
18 | public SkinMaterialAppBarLayout(Context context, AttributeSet attrs) {
19 | super(context, attrs);
20 | mBackgroundTintHelper = new SkinCompatBackgroundHelper(this);
21 | mBackgroundTintHelper.loadFromAttributes(attrs, 0);
22 | }
23 |
24 | @Override
25 | public void applySkin() {
26 | if (mBackgroundTintHelper != null) {
27 | mBackgroundTintHelper.applySkin();
28 | }
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/material/SkinMaterialCoordinatorLayout.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.material;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 |
6 | import androidx.coordinatorlayout.widget.CoordinatorLayout;
7 |
8 | import com.youngmanster.collection_kotlin.theme.widget.SkinCompatBackgroundHelper;
9 | import com.youngmanster.collection_kotlin.theme.widget.SkinCompatSupportable;
10 |
11 |
12 | public class SkinMaterialCoordinatorLayout extends CoordinatorLayout implements SkinCompatSupportable {
13 |
14 | private SkinCompatBackgroundHelper mBackgroundTintHelper;
15 |
16 | public SkinMaterialCoordinatorLayout(Context context) {
17 | this(context, null);
18 | }
19 |
20 | public SkinMaterialCoordinatorLayout(Context context, AttributeSet attrs) {
21 | this(context, attrs, 0);
22 | }
23 |
24 | public SkinMaterialCoordinatorLayout(Context context, AttributeSet attrs, int defStyleAttr) {
25 | super(context, attrs, defStyleAttr);
26 | mBackgroundTintHelper = new SkinCompatBackgroundHelper(this);
27 | mBackgroundTintHelper.loadFromAttributes(attrs, 0);
28 | }
29 |
30 | @Override
31 | public void applySkin() {
32 | if (mBackgroundTintHelper != null) {
33 | mBackgroundTintHelper.applySkin();
34 | }
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/observe/SkinObservable.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.observe;
2 |
3 | import java.util.ArrayList;
4 |
5 |
6 | public class SkinObservable {
7 | private final ArrayList observers;
8 |
9 | public SkinObservable() {
10 | observers = new ArrayList<>();
11 | }
12 |
13 | public synchronized void addObserver(SkinObserver o) {
14 | if (o == null) {
15 | throw new NullPointerException();
16 | }
17 | if (!observers.contains(o)) {
18 | observers.add(o);
19 | }
20 | }
21 |
22 | public synchronized void deleteObserver(SkinObserver o) {
23 | observers.remove(o);
24 | }
25 |
26 | public void notifyUpdateSkin() {
27 | notifyUpdateSkin(null);
28 | }
29 |
30 | public void notifyUpdateSkin(Object arg) {
31 | SkinObserver[] arrLocal;
32 |
33 | synchronized (this) {
34 | arrLocal = observers.toArray(new SkinObserver[observers.size()]);
35 | }
36 |
37 | for (int i = arrLocal.length-1; i>=0; i--) {
38 | arrLocal[i].updateSkin(this, arg);
39 | }
40 | }
41 |
42 | public synchronized void deleteObservers() {
43 | observers.clear();
44 | }
45 |
46 | public synchronized int countObservers() {
47 | return observers.size();
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/observe/SkinObserver.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.observe;
2 |
3 | public interface SkinObserver {
4 | void updateSkin(SkinObservable observable, Object o);
5 | }
6 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/res/SkinResources.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.res;
2 |
3 | interface SkinResources {
4 | void clear();
5 | }
6 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/utils/ImageUtils.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.utils;
2 |
3 | import android.media.ExifInterface;
4 |
5 | import java.io.IOException;
6 |
7 | public class ImageUtils {
8 | public static int getImageRotateAngle(String filePath) {
9 | ExifInterface exif;
10 | try {
11 | exif = new ExifInterface(filePath);
12 | } catch (IOException e) {
13 | e.printStackTrace();
14 | exif = null;
15 |
16 | }
17 | int angle = 0;
18 | if (exif != null) {
19 | int ori = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_UNDEFINED);
20 | switch (ori) {
21 | case ExifInterface.ORIENTATION_ROTATE_90:
22 | angle = 90;
23 | break;
24 | case ExifInterface.ORIENTATION_ROTATE_180:
25 | angle = 180;
26 | break;
27 | case ExifInterface.ORIENTATION_ROTATE_270:
28 | angle = 270;
29 | break;
30 | default:
31 | angle = 0;
32 | break;
33 | }
34 | }
35 | return angle;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/utils/SkinCompatV7ThemeUtils.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.utils;
2 |
3 | import android.content.Context;
4 |
5 | import static com.youngmanster.collection_kotlin.theme.utils.SkinCompatThemeUtils.getResId;
6 |
7 |
8 | /**
9 | * Created by ximsfei on 2017/3/25.
10 | */
11 |
12 | public class SkinCompatV7ThemeUtils {
13 |
14 | private static final int[] APPCOMPAT_COLOR_PRIMARY_ATTRS = {
15 | androidx.appcompat.R.attr.colorPrimary
16 | };
17 | private static final int[] APPCOMPAT_COLOR_PRIMARY_DARK_ATTRS = {
18 | androidx.appcompat.R.attr.colorPrimaryDark
19 | };
20 | private static final int[] APPCOMPAT_COLOR_ACCENT_ATTRS = {
21 | androidx.appcompat.R.attr.colorAccent
22 | };
23 |
24 | public static int getColorPrimaryResId(Context context) {
25 | return getResId(context, APPCOMPAT_COLOR_PRIMARY_ATTRS);
26 | }
27 |
28 | public static int getColorPrimaryDarkResId(Context context) {
29 | return getResId(context, APPCOMPAT_COLOR_PRIMARY_DARK_ATTRS);
30 | }
31 |
32 | public static int getColorAccentResId(Context context) {
33 | return getResId(context, APPCOMPAT_COLOR_ACCENT_ATTRS);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/utils/SkinConstants.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.utils;
2 |
3 | public class SkinConstants {
4 | public static final String KEY_SKIN_NAME = "KEY_SKIN_NAME";
5 | public static final String KEY_SKIN_STRATEGY = "KEY_SKIN_STRATEGY";
6 | public static final String KEY_SKIN_USER_THEME = "KEY_SKIN_USER_THEME";
7 | }
8 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/utils/Slog.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.utils;
2 |
3 | import android.util.Log;
4 |
5 | public class Slog {
6 | public static boolean DEBUG = false;
7 | private static final String TAG = "ThemeManager";
8 |
9 | public static void i(String msg) {
10 | if (DEBUG) {
11 | Log.i(TAG, msg);
12 | }
13 | }
14 |
15 | public static void i(String subtag, String msg) {
16 | if (DEBUG) {
17 | Log.i(TAG, subtag + ": " + msg);
18 | }
19 | }
20 |
21 | public static void r(String msg) {
22 | Log.i(TAG, msg);
23 | }
24 |
25 | public static void r(String subtag, String msg) {
26 | Log.i(TAG, subtag + ": " + msg);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/widget/SkinCompatFrameLayout.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.widget;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.FrameLayout;
6 |
7 |
8 | public class SkinCompatFrameLayout extends FrameLayout implements SkinCompatSupportable {
9 | private SkinCompatBackgroundHelper mBackgroundTintHelper;
10 |
11 | public SkinCompatFrameLayout(Context context) {
12 | this(context, null);
13 | }
14 |
15 | public SkinCompatFrameLayout(Context context, AttributeSet attrs) {
16 | this(context, attrs, 0);
17 | }
18 |
19 | public SkinCompatFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) {
20 | super(context, attrs, defStyleAttr);
21 | mBackgroundTintHelper = new SkinCompatBackgroundHelper(this);
22 | mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
23 | }
24 |
25 | @Override
26 | public void setBackgroundResource(int resId) {
27 | super.setBackgroundResource(resId);
28 | if (mBackgroundTintHelper != null) {
29 | mBackgroundTintHelper.onSetBackgroundResource(resId);
30 | }
31 | }
32 |
33 | @Override
34 | public void applySkin() {
35 | if (mBackgroundTintHelper != null) {
36 | mBackgroundTintHelper.applySkin();
37 | }
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/widget/SkinCompatHelper.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.widget;
2 |
3 |
4 | public abstract class SkinCompatHelper {
5 | protected static final String SYSTEM_ID_PREFIX = "1";
6 | public static final int INVALID_ID = 0;
7 |
8 | final static public int checkResourceId(int resId) {
9 | String hexResId = Integer.toHexString(resId);
10 | return hexResId.startsWith(SYSTEM_ID_PREFIX) ? INVALID_ID : resId;
11 | }
12 |
13 | abstract public void applySkin();
14 | }
15 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/widget/SkinCompatLinearLayout.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.widget;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.LinearLayout;
6 |
7 |
8 | public class SkinCompatLinearLayout extends LinearLayout implements SkinCompatSupportable {
9 | private SkinCompatBackgroundHelper mBackgroundTintHelper;
10 |
11 | public SkinCompatLinearLayout(Context context) {
12 | this(context, null);
13 | }
14 |
15 | public SkinCompatLinearLayout(Context context, AttributeSet attrs) {
16 | this(context, attrs, 0);
17 | }
18 |
19 | public SkinCompatLinearLayout(Context context, AttributeSet attrs, int defStyleAttr) {
20 | super(context, attrs, defStyleAttr);
21 | mBackgroundTintHelper = new SkinCompatBackgroundHelper(this);
22 | mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
23 | }
24 |
25 | @Override
26 | public void setBackgroundResource(int resId) {
27 | super.setBackgroundResource(resId);
28 | if (mBackgroundTintHelper != null) {
29 | mBackgroundTintHelper.onSetBackgroundResource(resId);
30 | }
31 | }
32 |
33 | @Override
34 | public void applySkin() {
35 | if (mBackgroundTintHelper != null) {
36 | mBackgroundTintHelper.applySkin();
37 | }
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/widget/SkinCompatProgressBar.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.widget;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.ProgressBar;
6 |
7 | public class SkinCompatProgressBar extends ProgressBar implements SkinCompatSupportable {
8 | private SkinCompatProgressBarHelper mSkinCompatProgressBarHelper;
9 |
10 | public SkinCompatProgressBar(Context context) {
11 | this(context, null);
12 | }
13 |
14 | public SkinCompatProgressBar(Context context, AttributeSet attrs) {
15 | this(context, attrs, android.R.attr.progressBarStyle);
16 | }
17 |
18 | public SkinCompatProgressBar(Context context, AttributeSet attrs, int defStyleAttr) {
19 | super(context, attrs, defStyleAttr);
20 | mSkinCompatProgressBarHelper = new SkinCompatProgressBarHelper(this);
21 | mSkinCompatProgressBarHelper.loadFromAttributes(attrs, defStyleAttr);
22 | }
23 |
24 | @Override
25 | public void applySkin() {
26 | if (mSkinCompatProgressBarHelper != null) {
27 | mSkinCompatProgressBarHelper.applySkin();
28 | }
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/widget/SkinCompatRadioGroup.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.widget;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.RadioGroup;
6 |
7 | public class SkinCompatRadioGroup extends RadioGroup implements SkinCompatSupportable {
8 | private SkinCompatBackgroundHelper mBackgroundTintHelper;
9 | public SkinCompatRadioGroup(Context context) {
10 | this(context, null);
11 | }
12 |
13 | public SkinCompatRadioGroup(Context context, AttributeSet attrs) {
14 | super(context, attrs);
15 | mBackgroundTintHelper = new SkinCompatBackgroundHelper(this);
16 | mBackgroundTintHelper.loadFromAttributes(attrs, 0);
17 | }
18 |
19 | @Override
20 | public void setBackgroundResource(int resId) {
21 | super.setBackgroundResource(resId);
22 | if (mBackgroundTintHelper != null) {
23 | mBackgroundTintHelper.onSetBackgroundResource(resId);
24 | }
25 | }
26 |
27 | @Override
28 | public void applySkin() {
29 | if (mBackgroundTintHelper != null) {
30 | mBackgroundTintHelper.applySkin();
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/widget/SkinCompatRatingBar.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.widget;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 |
6 | import androidx.appcompat.widget.AppCompatRatingBar;
7 |
8 | import com.youngmanster.collection_kotlin.R;
9 |
10 |
11 | public class SkinCompatRatingBar extends AppCompatRatingBar implements SkinCompatSupportable {
12 | private SkinCompatProgressBarHelper mSkinCompatProgressBarHelper;
13 |
14 | public SkinCompatRatingBar(Context context) {
15 | this(context, null);
16 | }
17 |
18 | public SkinCompatRatingBar(Context context, AttributeSet attrs) {
19 | this(context, attrs, R.attr.ratingBarStyle);
20 | }
21 |
22 | public SkinCompatRatingBar(Context context, AttributeSet attrs, int defStyleAttr) {
23 | super(context, attrs, defStyleAttr);
24 | mSkinCompatProgressBarHelper = new SkinCompatProgressBarHelper(this);
25 | mSkinCompatProgressBarHelper.loadFromAttributes(attrs, defStyleAttr);
26 | }
27 |
28 | @Override
29 | public void applySkin() {
30 | if (mSkinCompatProgressBarHelper != null) {
31 | mSkinCompatProgressBarHelper.applySkin();
32 | }
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/widget/SkinCompatRelativeLayout.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.widget;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.RelativeLayout;
6 |
7 |
8 | public class SkinCompatRelativeLayout extends RelativeLayout implements SkinCompatSupportable {
9 | private SkinCompatBackgroundHelper mBackgroundTintHelper;
10 |
11 | public SkinCompatRelativeLayout(Context context) {
12 | this(context, null);
13 | }
14 |
15 | public SkinCompatRelativeLayout(Context context, AttributeSet attrs) {
16 | this(context, attrs, 0);
17 | }
18 |
19 | public SkinCompatRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
20 | super(context, attrs, defStyleAttr);
21 | mBackgroundTintHelper = new SkinCompatBackgroundHelper(this);
22 | mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
23 | }
24 |
25 | @Override
26 | public void setBackgroundResource(int resId) {
27 | super.setBackgroundResource(resId);
28 | if (mBackgroundTintHelper != null) {
29 | mBackgroundTintHelper.onSetBackgroundResource(resId);
30 | }
31 | }
32 |
33 | @Override
34 | public void applySkin() {
35 | if (mBackgroundTintHelper != null) {
36 | mBackgroundTintHelper.applySkin();
37 | }
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/widget/SkinCompatSeekBar.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.widget;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 |
6 | import androidx.appcompat.widget.AppCompatSeekBar;
7 |
8 | import com.youngmanster.collection_kotlin.R;
9 |
10 | public class SkinCompatSeekBar extends AppCompatSeekBar implements SkinCompatSupportable {
11 | private SkinCompatSeekBarHelper mSkinCompatSeekBarHelper;
12 |
13 | public SkinCompatSeekBar(Context context) {
14 | this(context, null);
15 | }
16 |
17 | public SkinCompatSeekBar(Context context, AttributeSet attrs) {
18 | this(context, attrs, R.attr.seekBarStyle);
19 | }
20 |
21 | public SkinCompatSeekBar(Context context, AttributeSet attrs, int defStyleAttr) {
22 | super(context, attrs, defStyleAttr);
23 | mSkinCompatSeekBarHelper = new SkinCompatSeekBarHelper(this);
24 | mSkinCompatSeekBarHelper.loadFromAttributes(attrs, defStyleAttr);
25 | }
26 |
27 |
28 | @Override
29 | public void applySkin() {
30 | if (mSkinCompatSeekBarHelper != null) {
31 | mSkinCompatSeekBarHelper.applySkin();
32 | }
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/widget/SkinCompatSupportable.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.widget;
2 |
3 | public interface SkinCompatSupportable {
4 | void applySkin();
5 | }
6 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/widget/SkinCompatView.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.widget;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.View;
6 |
7 | public class SkinCompatView extends View implements SkinCompatSupportable {
8 | private SkinCompatBackgroundHelper mBackgroundTintHelper;
9 |
10 | public SkinCompatView(Context context) {
11 | this(context, null);
12 | }
13 |
14 | public SkinCompatView(Context context, AttributeSet attrs) {
15 | this(context, attrs, 0);
16 | }
17 |
18 | public SkinCompatView(Context context, AttributeSet attrs, int defStyleAttr) {
19 | super(context, attrs, defStyleAttr);
20 | mBackgroundTintHelper = new SkinCompatBackgroundHelper(this);
21 | mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
22 |
23 | }
24 |
25 | @Override
26 | public void setBackgroundResource(int resId) {
27 | super.setBackgroundResource(resId);
28 | if (mBackgroundTintHelper != null) {
29 | mBackgroundTintHelper.onSetBackgroundResource(resId);
30 | }
31 | }
32 |
33 | @Override
34 | public void applySkin() {
35 | if (mBackgroundTintHelper != null) {
36 | mBackgroundTintHelper.applySkin();
37 | }
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/theme/widget/SkinCompatViewGroup.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.theme.widget;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.ViewGroup;
6 |
7 | public abstract class SkinCompatViewGroup extends ViewGroup implements SkinCompatSupportable {
8 | private SkinCompatBackgroundHelper mBackgroundTintHelper;
9 |
10 | public SkinCompatViewGroup(Context context) {
11 | this(context, null);
12 | }
13 |
14 | public SkinCompatViewGroup(Context context, AttributeSet attrs) {
15 | this(context, attrs, 0);
16 | }
17 |
18 | public SkinCompatViewGroup(Context context, AttributeSet attrs, int defStyleAttr) {
19 | super(context, attrs, defStyleAttr);
20 | mBackgroundTintHelper = new SkinCompatBackgroundHelper(this);
21 | mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
22 |
23 | }
24 |
25 | @Override
26 | public void setBackgroundResource(int resId) {
27 | super.setBackgroundResource(resId);
28 | if (mBackgroundTintHelper != null) {
29 | mBackgroundTintHelper.onSetBackgroundResource(resId);
30 | }
31 | }
32 |
33 | @Override
34 | public void applySkin() {
35 | if (mBackgroundTintHelper != null) {
36 | mBackgroundTintHelper.applySkin();
37 | }
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/utils/ColorUtils.java:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.utils;
2 | import android.content.ContentValues;
3 | import android.content.Context;
4 | import android.content.res.ColorStateList;
5 |
6 | import androidx.core.content.ContextCompat;
7 |
8 | /**
9 | * Created by yangy
10 | * 2020-02-25
11 | * Describe:
12 | */
13 | public class ColorUtils {
14 |
15 | public static ColorStateList createColorStateList(Context context,int selected, int pressed, int normal) {
16 | int[] colors = new int[]{ContextCompat.getColor(context,selected), ContextCompat.getColor(context,pressed), ContextCompat.getColor(context,normal)};
17 | int[][] states = new int[3][];
18 | states[0] = new int[]{android.R.attr.state_selected};
19 | states[1] = new int[]{android.R.attr.state_pressed};
20 | states[2] = new int[]{};
21 | ColorStateList colorList = new ColorStateList(states, colors);
22 | return colorList;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/utils/MatchUtils.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.utils
2 |
3 | import java.util.regex.Pattern
4 |
5 | /**
6 | *
7 | * Created by LiaoYuQiang
8 | * on 2020/6/17
9 | */
10 | object MatchUtils {
11 |
12 | fun nameMatch(name:String):Boolean{
13 | val pattern = Pattern.compile("^[a-zA-Z0-9\\u4E00-\\u9FA5_\\-]+\$")
14 | return pattern.matcher(name).matches()
15 | }
16 | }
--------------------------------------------------------------------------------
/collection-kotlin/src/main/java/com/youngmanster/collection_kotlin/utils/SoftInputUtils.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin.utils
2 |
3 | import android.app.Activity
4 | import android.content.Context
5 | import android.view.inputmethod.InputMethodManager
6 | import android.widget.EditText
7 |
8 | /**
9 | * Created by yangy
10 | *2020-02-21
11 | *Describe:
12 | */
13 |
14 | class SoftInputUtils {
15 |
16 | companion object{
17 | fun hideSoftInput(context: Context) {
18 | val view = (context as Activity).window.peekDecorView()
19 | if (view != null) {
20 | val inputmanger =
21 | context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
22 | inputmanger.hideSoftInputFromWindow(view.windowToken, 0)
23 | }
24 | }
25 |
26 |
27 | fun showSoftInput(editText: EditText) {
28 | val inputManager =
29 | editText.context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
30 | inputManager.toggleSoftInput(0, InputMethodManager.SHOW_FORCED)
31 | }
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/anim/alpha_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/anim/alpha_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/anim/push_left_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/anim/push_right_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/anim/slide_left_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/anim/slide_left_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/anim/slide_right_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/anim/slide_right_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/drawable-v21/ripple_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/drawable/btn_assuere_border_bg_nol.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 |
9 |
10 |
11 |
12 | -
17 |
18 |
19 |
20 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/drawable/btn_assuere_border_bg_sel.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 |
9 |
10 |
11 |
12 | -
17 |
18 |
19 |
20 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/drawable/btn_cancel_border_bg_nol.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 |
9 |
10 |
11 |
12 | -
17 |
18 |
19 |
20 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/drawable/btn_cancel_border_bg_sel.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 |
9 |
10 |
11 |
12 | -
17 |
18 |
19 |
20 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/drawable/collection_library_selector_tagview.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/drawable/collection_library_shape_tagview.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/drawable/collection_library_shape_tagview_slector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/drawable/lib_ui_btn_border_bg_nol.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
10 |
11 |
12 |
13 | -
17 |
18 |
19 |
22 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/drawable/lib_ui_btn_border_bg_sel.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 |
11 |
12 |
13 |
14 | -
18 |
19 |
20 |
23 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/drawable/lib_ui_roundlayout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/drawable/lib_ui_selector_btn_border_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/drawable/lift_on_touch.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
7 |
8 |
13 |
14 |
15 | -
16 |
17 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/drawable/selector_btn_assuere_border_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/drawable/selector_btn_cancel_border_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/layout/collection_library_default_base_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
11 |
12 |
13 |
18 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/layout/collection_library_default_base_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
11 |
12 |
13 |
18 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/layout/collection_library_design_layout_tab_icon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/layout/collection_library_design_layout_tab_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/layout/collection_library_dialog_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
19 |
20 |
31 |
32 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/layout/collection_library_dialog_title_text_two_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
22 |
23 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/layout/collection_library_view_disconnect.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
16 |
17 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/layout/collection_library_view_empty.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
16 |
17 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/mipmap-xhdpi/collection_library_ic_bttom_loading_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/collection-kotlin/src/main/res/mipmap-xhdpi/collection_library_ic_bttom_loading_01.png
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/mipmap-xhdpi/collection_library_icon_disconnect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/collection-kotlin/src/main/res/mipmap-xhdpi/collection_library_icon_disconnect.png
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/mipmap-xhdpi/collection_library_icon_refresh_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/collection-kotlin/src/main/res/mipmap-xhdpi/collection_library_icon_refresh_arrow.png
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/collection-kotlin/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/collection-kotlin/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 |
--------------------------------------------------------------------------------
/collection-kotlin/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 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #66ccf5
4 | #ffffff
5 | #000000
6 | #008577
7 | #00574B
8 | #D81B60
9 | #333333
10 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/collection-kotlin/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 |
22 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
11 |
15 |
--------------------------------------------------------------------------------
/collection-kotlin/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/collection-kotlin/src/test/java/com/youngmanster/collection_kotlin/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.youngmanster.collection_kotlin
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
22 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usernameyangyan/Collection-Android-kotlin/bc7ed916e676075b35f719ec2d41e63f4ae6d9dd/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Feb 20 10:48:47 CST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
7 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':collection-kotlin'
2 | rootProject.name='Collection-Android-kotlin'
3 |
--------------------------------------------------------------------------------