├── .gitignore
├── .idea
├── .gitignore
├── androidTestResultsUserPreferences.xml
├── codeStyles
│ └── Project.xml
├── compiler.xml
├── gradle.xml
├── inspectionProfiles
│ └── Project_Default.xml
├── jarRepositories.xml
├── kotlinc.xml
├── misc.xml
├── qaplug_profiles.xml
├── sonarlint
│ ├── issuestore
│ │ ├── 1
│ │ │ └── 7
│ │ │ │ └── 174d5ae81d266abd9ce8406c8b4b6e38eb85dc1a
│ │ ├── 8
│ │ │ └── f
│ │ │ │ └── 8fa3baa4b99f7520b455d8d76ff4204fafafaab6
│ │ └── index.pb
│ └── securityhotspotstore
│ │ ├── 1
│ │ └── 7
│ │ │ └── 174d5ae81d266abd9ce8406c8b4b6e38eb85dc1a
│ │ ├── 8
│ │ └── f
│ │ │ └── 8fa3baa4b99f7520b455d8d76ff4204fafafaab6
│ │ └── index.pb
└── vcs.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
├── release
│ ├── app-release.apk
│ ├── basicUI.apk
│ ├── output-metadata.json
│ └── 二维码.png
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── peakmain
│ │ └── basicui
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── peakmain
│ │ │ └── basicui
│ │ │ ├── App.kt
│ │ │ ├── MainActivity.kt
│ │ │ ├── activity
│ │ │ ├── home
│ │ │ │ ├── AutoEditTextActivity.kt
│ │ │ │ ├── DialogActivity.kt
│ │ │ │ ├── KeyboardActivity.kt
│ │ │ │ ├── LockScreenActivity.kt
│ │ │ │ ├── MultiMenuActivity.kt
│ │ │ │ ├── NaviagtionBarActivity.kt
│ │ │ │ ├── PopWindowAndFlowActivity.kt
│ │ │ │ ├── ShapeTextViewActivity.kt
│ │ │ │ ├── TableLayoutActivity.kt
│ │ │ │ ├── WheelViewSelectorActivity.kt
│ │ │ │ ├── keyboard
│ │ │ │ │ ├── CustomIdKeyboardActivity.kt
│ │ │ │ │ ├── CustomPasswordKeyboardActivity.kt
│ │ │ │ │ └── CustomPointKeyboardActivity.kt
│ │ │ │ ├── loading
│ │ │ │ │ ├── LoadingActivity.kt
│ │ │ │ │ └── ShapeLoadingActivity.kt
│ │ │ │ └── recylcer
│ │ │ │ │ ├── RecyclerActivity.kt
│ │ │ │ │ ├── activity
│ │ │ │ │ ├── BaseRecyclerAcitvity.kt
│ │ │ │ │ ├── GridGroupingActivity.kt
│ │ │ │ │ ├── ItemTouchActivity.kt
│ │ │ │ │ ├── LinearGroupingActivity.kt
│ │ │ │ │ ├── MultiStateLayoutActivity.kt
│ │ │ │ │ ├── MultiTypeLayoutActivity.kt
│ │ │ │ │ ├── PullDownActivity1.kt
│ │ │ │ │ ├── PullDownActivity2.kt
│ │ │ │ │ ├── RecyclerViewHeadFooterActivity.kt
│ │ │ │ │ ├── SuspenisonGridActivity.java
│ │ │ │ │ └── SuspenisonLinearActivity.kt
│ │ │ │ │ ├── bean
│ │ │ │ │ └── GroupBean.kt
│ │ │ │ │ ├── data
│ │ │ │ │ └── PesudoImageData.kt
│ │ │ │ │ ├── itemDecoration
│ │ │ │ │ └── SuspenisonItemDecoration.kt
│ │ │ │ │ ├── itemTouchHelper
│ │ │ │ │ └── GridItemTouchHelper.kt
│ │ │ │ │ └── refreshload
│ │ │ │ │ ├── BestMissRefreshCreator.kt
│ │ │ │ │ └── LoadMoreCreator.kt
│ │ │ └── utils
│ │ │ │ ├── GlideActivity.kt
│ │ │ │ ├── LogActivity.java
│ │ │ │ ├── OkHttpActivity.kt
│ │ │ │ └── TextUtilsActivity.kt
│ │ │ ├── adapter
│ │ │ ├── BaseRecyclerStringAdapter.kt
│ │ │ ├── FlowLayoutAdapter.kt
│ │ │ ├── GroupGridAdapter.kt
│ │ │ ├── GroupLinearAdapter.kt
│ │ │ ├── ListMenuAdapter.kt
│ │ │ ├── MenuBrandAdapter.kt
│ │ │ ├── MenuHotCityAdapter.kt
│ │ │ ├── MenuLeftRecyclerAdapter.kt
│ │ │ ├── MenuRecommendSortAdapter.kt
│ │ │ ├── MenuRightRecyclerAdapter.kt
│ │ │ ├── MenuSubCategroyRightRecyclerAdapter.kt
│ │ │ ├── MenuSubRightRecyclerAdapter.kt
│ │ │ └── MultiTypeRecyclerAdapter.kt
│ │ │ ├── base
│ │ │ ├── BaseActivity.kt
│ │ │ └── BaseFragmnet.kt
│ │ │ ├── bean
│ │ │ ├── CategoryRightSubBean.kt
│ │ │ └── Person.kt
│ │ │ ├── fragment
│ │ │ ├── HomeFragment.kt
│ │ │ ├── ItemFragment.kt
│ │ │ ├── MineFragment.kt
│ │ │ └── UtilsFragment.kt
│ │ │ ├── launcher
│ │ │ ├── AMapTask.kt
│ │ │ ├── DeviceIdTask.kt
│ │ │ ├── JPushTask.kt
│ │ │ ├── UtilsTask.kt
│ │ │ └── WeexTask.kt
│ │ │ ├── utils
│ │ │ ├── ActivityUtil.java
│ │ │ └── JsonUtil.kt
│ │ │ └── view
│ │ │ ├── RadioCancelButton.kt
│ │ │ └── TableLayout.kt
│ └── res
│ │ ├── drawable-hdpi
│ │ └── bg_lable.png
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable-xhdpi
│ │ ├── bg_lable.png
│ │ ├── list_view_pull.png
│ │ ├── list_view_refreshing.png
│ │ ├── list_view_refreshing_1.png
│ │ ├── list_view_refreshing_2.png
│ │ └── list_view_release.png
│ │ ├── drawable
│ │ ├── atour.xml
│ │ ├── bg_lable.png
│ │ ├── check_bg.xml
│ │ ├── ic_bottom_navigation_home.xml
│ │ ├── ic_bottom_navigation_me.xml
│ │ ├── ic_bottom_navigation_utils.xml
│ │ ├── ic_launcher_background.xml
│ │ ├── ic_password_hide.xml
│ │ ├── ic_password_show.xml
│ │ ├── ic_triangle_down.xml
│ │ ├── ic_triangle_up.xml
│ │ ├── load_more_anim.xml
│ │ ├── logo.jpg
│ │ ├── select_bg.xml
│ │ └── selector_tab_color.xml
│ │ ├── layout
│ │ ├── activity
│ │ │ └── layout
│ │ │ │ ├── activity_auto_edit_text.xml
│ │ │ │ ├── activity_custom_id.xml
│ │ │ │ ├── activity_custom_keyboard_point.xml
│ │ │ │ ├── activity_custom_password.xml
│ │ │ │ ├── activity_data_base.xml
│ │ │ │ ├── activity_dialog_demo.xml
│ │ │ │ ├── activity_image_compress.xml
│ │ │ │ ├── activity_image_select.xml
│ │ │ │ ├── activity_lock_pattern.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── activity_menu_list.xml
│ │ │ │ ├── activity_multi_state.xml
│ │ │ │ ├── activity_navigation_bar.xml
│ │ │ │ ├── activity_pop_window_flow.xml
│ │ │ │ ├── activity_shape_loading.xml
│ │ │ │ ├── activity_shape_text_view.xml
│ │ │ │ ├── activity_table_layout.xml
│ │ │ │ ├── activity_text_utils.xml
│ │ │ │ └── menu_list_sub_view.xml
│ │ ├── activity_log_view.xml
│ │ ├── basic_grid_recycler_view.xml
│ │ ├── basic_head_foot_recycler_view.xml
│ │ ├── basic_linear_recycler_view.xml
│ │ ├── basic_load_refresh_recycler_view.xml
│ │ ├── dialog
│ │ │ └── layout
│ │ │ │ ├── dialog_bitmap_utils.xml
│ │ │ │ ├── dialog_constraintlayout.xml
│ │ │ │ ├── dialog_custom_keyboard_point.xml
│ │ │ │ ├── dialog_dowload_progress.xml
│ │ │ │ └── dialog_show.xml
│ │ ├── fragment
│ │ │ └── layout
│ │ │ │ ├── fragment_home.xml
│ │ │ │ ├── fragment_item.xml
│ │ │ │ ├── fragment_mine.xml
│ │ │ │ └── fragment_utils.xml
│ │ ├── item_flow_layout.xml
│ │ ├── item_group_head.xml
│ │ ├── item_label_popwindow_view.xml
│ │ ├── item_recycler_group.xml
│ │ ├── item_recycler_menu_brand.xml
│ │ ├── item_recycler_menu_categroy_right.xml
│ │ ├── item_recycler_menu_categroy_right_sub.xml
│ │ ├── item_recycler_menu_hot_city.xml
│ │ ├── item_recycler_menu_recommend_sort.xml
│ │ ├── item_recyclerview_categropy_sub.xml
│ │ ├── item_recyclerview_home.xml
│ │ ├── layout__bestmiss_refresh_header_view.xml
│ │ ├── layout_categorize_screen.xml
│ │ ├── layout_load_footer_view.xml
│ │ ├── layout_menu_brand.xml
│ │ ├── layout_menu_recommend_sort.xml
│ │ ├── recycler_view_image.xml
│ │ ├── suspend_recycler_view.xml
│ │ ├── ui_list_data_screen_menu_100.xml
│ │ ├── ui_list_data_screen_tab.xml
│ │ ├── ui_list_menu_content.xml
│ │ └── view_header_footer.xml
│ │ ├── menu
│ │ └── bottom_navigation_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.jpg
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.jpg
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.jpg
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_default_portrait.png
│ │ ├── ic_launcher.jpg
│ │ └── list_load_more.png
│ │ ├── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ │ └── xml
│ │ └── network_security_config.xml
│ └── test
│ └── java
│ └── com
│ └── peakmain
│ └── basicui
│ └── AppTest.kt
├── basicuUI.keystore
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── jitpack.yml
├── settings.gradle
└── ui
├── .gitignore
├── CMakeLists.txt
├── build.gradle
├── consumer-rules.pro
├── libjpeg
├── jpeg
│ ├── cderror.h
│ ├── cdjpeg.h
│ ├── config.h
│ ├── jconfig.h
│ ├── jerror.h
│ ├── jinclude.h
│ ├── jmorecfg.h
│ ├── jpeglib.h
│ └── jversion.h
└── so
│ ├── arm64-v8a
│ └── libjpeg.so
│ ├── armeabi-v7a
│ └── libjpeg.so
│ └── x86
│ └── libjpeg.so
├── proguard-rules.pro
└── src
├── androidTest
└── java
│ └── com
│ └── peakmain
│ └── ui
│ └── ExampleInstrumentedTest.java
└── main
├── AndroidManifest.xml
├── cpp
├── compress-lib.cpp
├── include
│ └── gif
│ │ ├── gif_hash.h
│ │ ├── gif_lib.h
│ │ └── gif_lib_private.h
└── src
│ └── gif
│ ├── dgif_lib.c
│ ├── egif_lib.c
│ ├── gif_err.c
│ ├── gif_font.c
│ ├── gif_hash.c
│ ├── gifalloc.c
│ └── quantize.c
├── java
└── com
│ └── peakmain
│ └── ui
│ ├── BasicUIProvider.kt
│ ├── adapter
│ ├── BaseAdapter.kt
│ ├── BaseViewPagerAdapter.java
│ ├── flow
│ │ ├── BaseFlowAdapter.kt
│ │ └── FlowObserver.kt
│ └── menu
│ │ ├── BaseListMenuAdapter.kt
│ │ ├── BaseMenuAdapter.kt
│ │ └── MenuObserver.kt
│ ├── compress
│ ├── Checker.kt
│ ├── CompressUtils.kt
│ ├── ImageCompressUtils.kt
│ ├── ImageCompute.kt
│ └── OnCompressListener.kt
│ ├── constants
│ ├── BasicUIUtils.kt
│ └── ReflectUtils.kt
│ ├── dialog
│ ├── AlertController.kt
│ ├── AlertDialog.kt
│ └── ViewHelper.kt
│ ├── ext
│ └── ViewExt.kt
│ ├── image
│ └── gif
│ │ └── GifHelper.java
│ ├── imageLoader
│ ├── ILoader.kt
│ ├── ImageLoader.kt
│ ├── ImageRecyclerScrollListener.kt
│ ├── factory
│ │ ├── AbstractLoaderFactory.kt
│ │ └── GlideLoaderFactory.kt
│ ├── glide
│ │ └── GlideLoader.kt
│ └── transform
│ │ └── CornerTransform.kt
│ ├── loading
│ ├── CircleLoadingView.kt
│ ├── CircleView.kt
│ ├── ShapeLoadingView.kt
│ └── ShapeView.kt
│ ├── navigationbar
│ ├── AbsNavigationBar.kt
│ ├── DefaultNavigationBar.kt
│ ├── INavigation.kt
│ ├── NavigationBar.kt
│ └── NavigationParameter.kt
│ ├── recyclerview
│ ├── adapter
│ │ ├── CommonRecyclerAdapter.kt
│ │ ├── MultiTypeSupport.kt
│ │ ├── ViewHolder.kt
│ │ └── WrapRecyclerAdapter.kt
│ ├── creator
│ │ ├── DefaultLoadViewCreator.kt
│ │ ├── DefaultRefreshViewCreator.kt
│ │ ├── LoadViewCreator.kt
│ │ └── RefreshViewCreator.kt
│ ├── group
│ │ ├── BaseGridGroupRecyclerAdapter.java
│ │ ├── BaseGroupRecyclerAdapter.kt
│ │ ├── GroupMultiType.kt
│ │ └── GroupRecyclerBean.kt
│ ├── itemdecoration
│ │ ├── BaseSuspenisonItemDecoration.kt
│ │ ├── CenterHorizontalDecoration.kt
│ │ ├── DividerGridItemDecoration.kt
│ │ └── DividerItemDecoration.kt
│ ├── itemtouch
│ │ └── BaseItemTouchHelper.java
│ ├── listener
│ │ ├── OnItemClickListener.kt
│ │ └── OnLongClickListener.kt
│ ├── manager
│ │ └── RecyclerViewManager.kt
│ ├── smooth
│ │ ├── CenterSmoothScroller.kt
│ │ ├── EndSmoothScroller.kt
│ │ └── TopSmoothScroller.kt
│ └── view
│ │ ├── LoadRefreshRecyclerView.kt
│ │ ├── RefreshRecyclerView.kt
│ │ └── WrapRecyclerView.kt
│ ├── tablayout
│ ├── BaseTabLayout.kt
│ └── ColorTrackTextView.kt
│ ├── utils
│ ├── ActivityUtils.kt
│ ├── AppUtils.kt
│ ├── BitmapUtils.kt
│ ├── BubbleUtils.kt
│ ├── FileUtils.kt
│ ├── FragmentManagerHelper.kt
│ ├── HandlerUtils.kt
│ ├── LogUtils.kt
│ ├── MathUtils.kt
│ ├── OkHttpManager.kt
│ ├── PreferencesUtil.kt
│ ├── SizeUtils.kt
│ ├── TextUtils.kt
│ ├── ToastUtils.java
│ ├── UIViewOffsetUtils.kt
│ ├── fps
│ │ ├── FpsMonitorUtils.kt
│ │ └── FrameMonitor.kt
│ ├── launcher
│ │ ├── dispatcher
│ │ │ ├── DelayInitDispatcher.kt
│ │ │ └── TaskDispatcher.kt
│ │ ├── sort
│ │ │ ├── Graph.java
│ │ │ └── TaskSortUtil.kt
│ │ ├── stat
│ │ │ ├── TaskStat.kt
│ │ │ └── TaskStatBean.kt
│ │ ├── task
│ │ │ ├── DispatchRunnable.kt
│ │ │ ├── ITask.kt
│ │ │ ├── MainTask.kt
│ │ │ ├── Task.kt
│ │ │ └── TaskCallBack.kt
│ │ └── tools
│ │ │ └── DispatcherExecutor.kt
│ ├── log
│ │ ├── ConsolePrinter.java
│ │ ├── FilePrinter.java
│ │ ├── LogConfig.java
│ │ ├── LogFormatter.java
│ │ ├── LogManager.java
│ │ ├── LogPrinter.java
│ │ ├── LogRecord.java
│ │ ├── PLog.java
│ │ ├── StackTraceFormatter.java
│ │ ├── StackTraceUtil.java
│ │ ├── ThreadFormatter.java
│ │ ├── ViewPrinter.java
│ │ └── ViewPrinterProvider.java
│ ├── network
│ │ ├── HttpUtils.kt
│ │ ├── IHttpEngine.kt
│ │ ├── OkHttpEngine.kt
│ │ ├── body
│ │ │ └── ExMultipartBody.kt
│ │ ├── callback
│ │ │ ├── DownloadCallback.kt
│ │ │ ├── EngineCallBack.kt
│ │ │ ├── ProgressEngineCallBack.kt
│ │ │ └── UploadProgressListener.kt
│ │ ├── download
│ │ │ ├── DownloadDispatcher.kt
│ │ │ ├── DownloadRunnable.kt
│ │ │ └── DownloadTask.kt
│ │ ├── intercept
│ │ │ ├── CacheResponseInterceptor.kt
│ │ │ └── LoggerInterceptor.kt
│ │ └── model
│ │ │ └── DownloadProgress.kt
│ └── wheel
│ │ ├── DateUtils.kt
│ │ ├── LunarCalendarUtil.kt
│ │ └── WheelTimeUtil.kt
│ ├── wheelview
│ ├── adapter
│ │ ├── ArrayWheelAdapter.java
│ │ ├── NumericWheelAdapter.java
│ │ └── WheelAdapter.kt
│ ├── interfaces
│ │ └── IPickerViewData.kt
│ ├── listener
│ │ ├── LoopViewGestureListener.kt
│ │ └── OnItemSelectedListener.kt
│ ├── timer
│ │ ├── InertiaTimerTask.kt
│ │ ├── MessageHandler.kt
│ │ └── SmoothScrollTimerTask.kt
│ └── view
│ │ ├── BaseWheelView.kt
│ │ ├── GenderWheelView.kt
│ │ ├── SingleWheelWindow.kt
│ │ ├── TimePickerWheelView.kt
│ │ └── WheelView.java
│ └── widget
│ ├── AutoDeleteEditText.kt
│ ├── CircleImageView.kt
│ ├── CrumbView.kt
│ ├── CustomPopupWindow.kt
│ ├── FlowLayout.kt
│ ├── RoundCheckBox.kt
│ ├── ShapeConstraintLayout.kt
│ ├── ShapeLinearLayout.kt
│ ├── ShapeTextView.kt
│ ├── SlideFrameLayout.kt
│ ├── SquareFrameLayout.kt
│ ├── SquareImageView.kt
│ ├── SuspensionView.kt
│ ├── listener
│ ├── CustomeKeyboardListener.kt
│ └── SimpleCustomKeyboardListener.kt
│ ├── lock
│ └── LockScreenView.kt
│ ├── menu
│ └── ListMenuView.kt
│ └── password
│ ├── CustomerKeyboard.java
│ └── PasswordEditText.java
└── res
├── anim
├── dialog_from_bottom_anim_in.xml
├── dialog_from_bottom_anim_out.xml
├── dialog_scale_anim_in.xml
├── dialog_scale_anim_out.xml
├── ui_activity_enter_transition_anim.xml
└── ui_activity_exit_transition_anim.xml
├── drawable-xxhdpi
├── ic_error.png
├── ic_no_data.png
└── ic_no_network.png
├── drawable
├── ic_address_select.xml
├── ic_customer_keyboard_delete.xml
├── ic_et_close.xml
├── ic_keyboard_arrow_down.xml
├── ic_keyboard_hide.xml
├── ic_log_flod_description_24.xml
├── ic_more.xml
├── ic_progress_circle.xml
├── shape_loading_shadow_bg.xml
├── ui_ic_arrow_right.xml
├── ui_ic_baseline_close_24.xml
├── ui_ic_left_back.xml
├── ui_ic_media_chooser.xml
├── ui_ic_media_chooser_selected.xml
├── ui_ic_media_chooser_unselected.xml
├── ui_ic_photo_camera.xml
├── ui_ic_suspension_setting.xml
├── ui_num_oval_background.xml
├── ui_picture_preview_text_color.xml
├── ui_preview_close.xml
└── ui_preview_download.xml
├── layout
├── layout_empty_view.xml
├── layout_error_view.xml
├── layout_loading_view.xml
├── layout_network_view.xml
├── log_item.xml
├── ui_auto_delete_edittext.xml
├── ui_crumb_item_header.xml
├── ui_crumb_item_layout.xml
├── ui_custom_keyboard.xml
├── ui_default_refresh_view.xml
├── ui_defualt_navigation_bar.xml
├── ui_fps_view.xml
├── ui_fragment_file_list.xml
├── ui_fragment_image_select.xml
├── ui_item_base_wheelview.xml
├── ui_item_file_list_adapter.xml
├── ui_item_recycle_group_head.xml
└── ui_shape_view.xml
├── values
├── attrs.xml
├── colors.xml
├── ids.xml
├── strings.xml
└── styles.xml
└── xml
└── basic_ui_provider_paths.xml
/.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/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/.idea/androidTestResultsUserPreferences.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
22 |
23 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
20 |
21 |
--------------------------------------------------------------------------------
/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/sonarlint/issuestore/1/7/174d5ae81d266abd9ce8406c8b4b6e38eb85dc1a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/.idea/sonarlint/issuestore/1/7/174d5ae81d266abd9ce8406c8b4b6e38eb85dc1a
--------------------------------------------------------------------------------
/.idea/sonarlint/issuestore/8/f/8fa3baa4b99f7520b455d8d76ff4204fafafaab6:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/.idea/sonarlint/issuestore/8/f/8fa3baa4b99f7520b455d8d76ff4204fafafaab6
--------------------------------------------------------------------------------
/.idea/sonarlint/issuestore/index.pb:
--------------------------------------------------------------------------------
1 |
2 | v
3 | Fui/src/main/java/com/peakmain/ui/navigationbar/DefaultNavigationBar.kt,1/7/174d5ae81d266abd9ce8406c8b4b6e38eb85dc1a
4 | t
5 | Dui/src/main/java/com/peakmain/ui/adapter/menu/BaseListMenuAdapter.kt,8/f/8fa3baa4b99f7520b455d8d76ff4204fafafaab6
--------------------------------------------------------------------------------
/.idea/sonarlint/securityhotspotstore/1/7/174d5ae81d266abd9ce8406c8b4b6e38eb85dc1a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/.idea/sonarlint/securityhotspotstore/1/7/174d5ae81d266abd9ce8406c8b4b6e38eb85dc1a
--------------------------------------------------------------------------------
/.idea/sonarlint/securityhotspotstore/8/f/8fa3baa4b99f7520b455d8d76ff4204fafafaab6:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/.idea/sonarlint/securityhotspotstore/8/f/8fa3baa4b99f7520b455d8d76ff4204fafafaab6
--------------------------------------------------------------------------------
/.idea/sonarlint/securityhotspotstore/index.pb:
--------------------------------------------------------------------------------
1 |
2 | v
3 | Fui/src/main/java/com/peakmain/ui/navigationbar/DefaultNavigationBar.kt,1/7/174d5ae81d266abd9ce8406c8b4b6e38eb85dc1a
4 | t
5 | Dui/src/main/java/com/peakmain/ui/adapter/menu/BaseListMenuAdapter.kt,8/f/8fa3baa4b99f7520b455d8d76ff4204fafafaab6
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 |
2 | # 保持哪些类不被混淆
3 | -keep public class * extends android.app.Fragment
4 | -keep public class * extends android.app.Activity
5 | -keep public class * extends android.app.Application
6 | -keep public class * extends android.app.Service
7 | -keep public class * extends android.content.BroadcastReceiver
8 | -keep public class * extends android.content.ContentProvider
9 | -keep public class * extends android.app.backup.BackupAgentHelper
10 | -keep public class * extends android.preference.Preference
11 | -assumenosideeffects class android.util.Log {
12 | public static boolean isLoggable(java.lang.String, int);
13 | public static int v(...);
14 | public static int i(...);
15 | public static int w(...);
16 | public static int d(...);
17 | public static int e(...);
18 | }
19 | # AndroidX
20 | -keep class com.google.android.material.**{*;}
21 | -keep class androidx.**{*;}
22 | -keep public class * extends androidx.**
23 | -keep interface androidx.**{*;}
24 | -keep @androidx.annotation.Keep class *
25 | -keepclassmembers class *{
26 | @androidx.annotation.Keep *;
27 | }
28 | -dontwarn com.google.android.material.**
29 | -dontnote com.google.android.material.**
30 | -dontwarn androidx.**
31 | -keep class com.peakmain.basicui.bean.*{*;}
32 |
33 | -keepattributes Signature
34 | -keepattributes *Annotation*
35 | -keep class com.google.gson.** {*;}
36 | -keep class com.google.**{*;}
37 | -keep class com.google.gson.stream.** { *; }
38 | -keep class com.google.gson.examples.android.model.** { *; }
--------------------------------------------------------------------------------
/app/release/app-release.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/release/app-release.apk
--------------------------------------------------------------------------------
/app/release/basicUI.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/release/basicUI.apk
--------------------------------------------------------------------------------
/app/release/output-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "artifactType": {
4 | "type": "APK",
5 | "kind": "Directory"
6 | },
7 | "applicationId": "com.peakmain.basicui",
8 | "variantName": "release",
9 | "elements": [
10 | {
11 | "type": "SINGLE",
12 | "filters": [],
13 | "properties": [],
14 | "versionCode": 2,
15 | "versionName": "1.1",
16 | "enabled": true,
17 | "outputFile": "app-release.apk"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/app/release/二维码.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/release/二维码.png
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/peakmain/basicui/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui;
2 |
3 | import static org.junit.Assert.assertNotNull;
4 |
5 | import androidx.test.ext.junit.runners.AndroidJUnit4;
6 |
7 | import com.peakmain.ui.constants.BasicUIUtils;
8 |
9 | import org.junit.Test;
10 | import org.junit.runner.RunWith;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | assertNotNull(BasicUIUtils.getApplication());
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/App.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui
2 |
3 | import android.app.Application
4 | import android.os.Handler
5 | import android.os.Looper
6 | import com.peakmain.basicui.launcher.*
7 | import com.peakmain.ui.utils.ActivityUtils
8 | import com.peakmain.ui.utils.launcher.dispatcher.TaskDispatcher.Companion.createInstance
9 | import com.peakmain.ui.utils.launcher.dispatcher.TaskDispatcher.Companion.init
10 |
11 | /**
12 | * author :Peakmain
13 | * createTime:2020/3/9
14 | * mail:2726449200@qq.com
15 | * describe:
16 | */
17 | class App : Application() {
18 | var deviceId: String? = null
19 | override fun onCreate() {
20 | super.onCreate()
21 | app = this
22 | init(this)
23 | val dispatcher = createInstance()
24 | dispatcher.addTask(AMapTask())
25 | .addTask(UtilsTask())
26 | .addTask(JPushTask())
27 | .addTask(DeviceIdTask())
28 | .addTask(WeexTask())
29 | .start()
30 | ActivityUtils.mInstance.init(this)
31 | //异常初始化
32 | // CrashUtils.init()
33 | }
34 |
35 | companion object {
36 | /**
37 | * 获取Application
38 | *
39 | * @return Application
40 | */
41 | var app: Application? = null
42 | private set
43 | private val APP_HANDLER = Handler(Looper.getMainLooper())
44 | fun runOnUiThread(runnable: Runnable) {
45 | if (Looper.myLooper() == Looper.getMainLooper()) {
46 | runnable.run()
47 | } else {
48 | APP_HANDLER.post(runnable)
49 | }
50 | }
51 |
52 | }
53 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/activity/home/AutoEditTextActivity.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.activity.home
2 |
3 | import com.peakmain.basicui.R
4 | import com.peakmain.basicui.base.BaseActivity
5 | import com.peakmain.ui.widget.AutoDeleteEditText
6 |
7 | /**
8 | * author :Peakmain
9 | * createTime:2020/3/11
10 | * mail:2726449200@qq.com
11 | * describe:
12 | */
13 | class AutoEditTextActivity : BaseActivity() {
14 | override fun getLayoutId(): Int {
15 | return R.layout.activity_auto_edit_text
16 | }
17 |
18 | override fun initView() {
19 | mNavigationBuilder!!.setTitleText("AutoEditText的使用")
20 | .create()
21 | findViewById(R.id.auto_edit_text).setText("你好,我是Peakmain")
22 | }
23 |
24 | override fun initData() {}
25 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/activity/home/LockScreenActivity.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.activity.home
2 |
3 | import com.peakmain.basicui.R
4 | import com.peakmain.basicui.base.BaseActivity
5 | import com.peakmain.ui.utils.ToastUtils
6 | import com.peakmain.ui.widget.lock.LockScreenView
7 | import com.peakmain.ui.widget.lock.LockScreenView.OnLockSuccessListener
8 |
9 | /**
10 | * author :Peakmain
11 | * createTime:2020/3/15
12 | * mail:2726449200@qq.com
13 | * describe:锁屏的activity
14 | */
15 | class LockScreenActivity : BaseActivity() {
16 | private var mLockScreenView: LockScreenView? = null
17 | override fun getLayoutId(): Int {
18 | return R.layout.activity_lock_pattern
19 | }
20 |
21 | override fun initView() {
22 | mLockScreenView = findViewById(R.id.lock_pattern)
23 | mNavigationBuilder!!.setTitleText("九宫格解锁").create()
24 | }
25 |
26 | override fun initData() {
27 | mLockScreenView!!.setOnLockSuccessListener(object : OnLockSuccessListener {
28 | override val lockResult: String
29 | get() = "123456"
30 |
31 | override fun onLockSuccess(pwd: String?) {
32 | ToastUtils.showShort("密码正确,正在探索BasicUI......")
33 | finish()
34 | }
35 | })
36 | }
37 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/activity/home/ShapeTextViewActivity.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.activity.home
2 |
3 | import android.graphics.Color
4 | import com.peakmain.basicui.R
5 | import com.peakmain.basicui.base.BaseActivity
6 | import com.peakmain.ui.widget.ShapeTextView
7 |
8 | /**
9 | * author :Peakmain
10 | * createTime:2020/3/11
11 | * mail:2726449200@qq.com
12 | * describe:
13 | */
14 | class ShapeTextViewActivity : BaseActivity() {
15 | override fun getLayoutId(): Int {
16 | return R.layout.activity_shape_text_view
17 | }
18 |
19 | override fun initView() {
20 | mNavigationBuilder!!.setTitleText("ShapeTextView的使用").create()
21 | findViewById(R.id.stv_pressed_color)
22 | .setPressedColor(Color.GRAY)
23 |
24 | findViewById(R.id.stv_enable_color)
25 | .setUnEnabledColor(Color.BLUE)
26 | }
27 |
28 | override fun initData() {}
29 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/activity/home/keyboard/CustomIdKeyboardActivity.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.activity.home.keyboard
2 |
3 | import com.peakmain.basicui.R
4 | import com.peakmain.basicui.base.BaseActivity
5 | import com.peakmain.ui.utils.ToastUtils
6 | import com.peakmain.ui.widget.listener.SimpleCustomKeyboardListener
7 | import com.peakmain.ui.widget.password.CustomerKeyboard
8 | import com.peakmain.ui.widget.password.PasswordEditText
9 |
10 | /**
11 | * author :Peakmain
12 | * createTime:2020/3/12
13 | * mail:2726449200@qq.com
14 | * describe:自定义身份证键盘
15 | */
16 | class CustomIdKeyboardActivity : BaseActivity() {
17 | private var mCustomerKeyboard: CustomerKeyboard? = null
18 | private var mEditText: PasswordEditText? = null
19 | override fun getLayoutId(): Int {
20 | return R.layout.activity_custom_id
21 | }
22 |
23 | override fun initView() {
24 | mCustomerKeyboard = findViewById(R.id.custom_key_board)
25 | mEditText = findViewById(R.id.password_edit_text)
26 | mNavigationBuilder!!.setTitleText("自定义身份证键盘").create()
27 | }
28 |
29 | override fun initData() {
30 | mCustomerKeyboard!!.setOnCustomerKeyboardClickListener(object : SimpleCustomKeyboardListener() {
31 | override fun click(number: String?) {
32 | mEditText!!.addPasswordNumber(number)
33 | }
34 |
35 | override fun delete() {
36 | mEditText!!.deletePassWord()
37 | }
38 | })
39 | mEditText!!.setPasswordCompleteListener { text: String? -> ToastUtils.showShort(text!!) }
40 | }
41 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/activity/home/loading/ShapeLoadingActivity.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.activity.home.loading
2 |
3 | import android.os.Handler
4 | import android.os.Looper
5 | import android.view.View
6 | import com.peakmain.basicui.R
7 | import com.peakmain.basicui.base.BaseActivity
8 | import com.peakmain.ui.loading.ShapeLoadingView
9 |
10 | /**
11 | * author :Peakmain
12 | * createTime:2020/3/18
13 | * mail:2726449200@qq.com
14 | * describe:
15 | */
16 | class ShapeLoadingActivity : BaseActivity() {
17 | private var mShapeLoadingView: ShapeLoadingView? = null
18 | private val mHandler = Handler(Looper.getMainLooper())
19 | override fun getLayoutId(): Int {
20 | return R.layout.activity_shape_loading
21 | }
22 |
23 | override fun initView() {
24 | mShapeLoadingView = findViewById(R.id.shape_loading_view)
25 | mNavigationBuilder!!.setTitleText("仿老版58同城加载loading").create()
26 | }
27 |
28 | override fun initData() {
29 | mShapeLoadingView!!.setLoadingName("数据正在加载....")
30 | }
31 |
32 | fun start(view: View?) {
33 | val shapeLoadingView = ShapeLoadingView(this)
34 | shapeLoadingView.show()
35 | mHandler.postDelayed({ shapeLoadingView.hide() }, 2000)
36 | }
37 |
38 | fun click(view: View?) {
39 | mShapeLoadingView!!.hide()
40 | }
41 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/activity/home/recylcer/activity/GridGroupingActivity.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.activity.home.recylcer.activity
2 |
3 | import com.peakmain.basicui.R
4 |
5 | /**
6 | * author :Peakmain
7 | * createTime:2020/3/22
8 | * mail:2726449200@qq.com
9 | * describe:
10 | */
11 | class GridGroupingActivity : BaseRecyclerAcitvity() {
12 | override fun getLayoutId(): Int {
13 | return R.layout.basic_grid_recycler_view
14 | }
15 |
16 | override fun initData() {
17 | mNavigationBuilder!!.setTitleText("GridLayoutManager实现分组").create()
18 | mGroupAdapter!!.adjustSpanSize(mRecyclerView!!)
19 | mRecyclerView!!.adapter = mGroupAdapter
20 | }
21 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/activity/home/recylcer/activity/ItemTouchActivity.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.activity.home.recylcer.activity
2 |
3 | import android.util.Log
4 | import androidx.recyclerview.widget.ItemTouchHelper
5 | import com.peakmain.basicui.BuildConfig
6 | import com.peakmain.basicui.R
7 | import com.peakmain.basicui.activity.home.recylcer.itemTouchHelper.GridItemTouchHelper
8 |
9 | /**
10 | * author :Peakmain
11 | * createTime:2020/3/25
12 | * mail:2726449200@qq.com
13 | * describe:
14 | */
15 | class ItemTouchActivity : BaseRecyclerAcitvity() {
16 | override fun getLayoutId(): Int {
17 | return R.layout.basic_grid_recycler_view
18 | }
19 |
20 | override fun initData() {
21 | mRecyclerView!!.adapter = mGroupAdapter
22 | mNavigationBuilder?.setTitleText("itemTouchHelp方法实现删除和拖拽")?.create()
23 | val itemTouchHelper = GridItemTouchHelper(mGroupAdapter, mGroupBeans)
24 | itemTouchHelper.attachToRecyclerView(mRecyclerView)
25 | mGroupAdapter!!.adjustSpanSize(mRecyclerView!!)
26 | //获取更新后的数据
27 | itemTouchHelper.setOnDataUpdatedListener {
28 | for (data in it) {
29 | Log.e(BuildConfig.TAG, if (data!!.isHeader) "head" else data.url?:"")
30 | }
31 | }.setGridDragFlags(ItemTouchHelper.UP)
32 | }
33 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/activity/home/recylcer/activity/LinearGroupingActivity.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.activity.home.recylcer.activity
2 |
3 | import com.peakmain.basicui.R
4 |
5 | /**
6 | * author :Peakmain
7 | * createTime:2020/3/23
8 | * mail:2726449200@qq.com
9 | * describe:
10 | */
11 | class LinearGroupingActivity : BaseRecyclerAcitvity() {
12 | override fun getLayoutId(): Int {
13 | return R.layout.basic_linear_recycler_view
14 | }
15 |
16 | override fun initData() {
17 | mNavigationBuilder!!.setTitleText("LinearLayoutManager实现分组").create()
18 | mRecyclerView!!.adapter = mGroupAdapter
19 | }
20 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/activity/home/recylcer/activity/SuspenisonGridActivity.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.activity.home.recylcer.activity;
2 |
3 | import android.graphics.Typeface;
4 |
5 | import com.peakmain.basicui.R;
6 | import com.peakmain.basicui.activity.home.recylcer.itemDecoration.SuspenisonItemDecoration;
7 | import com.peakmain.basicui.adapter.GroupGridAdapter;
8 | import com.peakmain.ui.recyclerview.itemdecoration.BaseSuspenisonItemDecoration;
9 |
10 | /**
11 | * author :Peakmain
12 | * createTime:2020/3/23
13 | * mail:2726449200@qq.com
14 | * describe:
15 | */
16 | public class SuspenisonGridActivity extends BaseRecyclerAcitvity {
17 |
18 | @Override
19 | protected int getLayoutId() {
20 | return R.layout.basic_grid_recycler_view;
21 | }
22 |
23 |
24 | @Override
25 | protected void initData() {
26 | if (mNavigationBuilder != null)
27 | mNavigationBuilder.setTitleText("GridLayoutManager实现悬浮", Typeface.DEFAULT).create();
28 | BaseSuspenisonItemDecoration itemDecoration = new SuspenisonItemDecoration
29 | .Builder(this, mGroupBeans)
30 | .setTextCenter(true).create();
31 | if (mRecyclerView != null) {
32 | if (itemDecoration != null)
33 | mRecyclerView.addItemDecoration(itemDecoration);
34 | GroupGridAdapter mGroupAdapter = new GroupGridAdapter(this, mGroupBeans);
35 | mRecyclerView.setAdapter(mGroupAdapter);
36 | mGroupAdapter.adjustSpanSize(mRecyclerView);
37 | }
38 |
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/activity/home/recylcer/activity/SuspenisonLinearActivity.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.activity.home.recylcer.activity
2 |
3 | import androidx.recyclerview.widget.RecyclerView
4 | import com.peakmain.basicui.R
5 | import com.peakmain.basicui.activity.home.recylcer.bean.GroupBean
6 | import com.peakmain.basicui.activity.home.recylcer.data.PesudoImageData.Companion.instance
7 | import com.peakmain.basicui.activity.home.recylcer.itemDecoration.SuspenisonItemDecoration
8 | import com.peakmain.basicui.adapter.GroupLinearAdapter
9 | import com.peakmain.basicui.base.BaseActivity
10 |
11 |
12 | /**
13 | * author :Peakmain
14 | * createTime:2020/3/23
15 | * mail:2726449200@qq.com
16 | * describe:
17 | */
18 | class SuspenisonLinearActivity : BaseActivity() {
19 | protected lateinit var mGroupBeans: MutableList
20 | protected var mGroupAdapter: GroupLinearAdapter? = null
21 | protected var mRecyclerView: RecyclerView? = null
22 | override fun getLayoutId(): Int {
23 | return R.layout.suspend_recycler_view
24 | }
25 |
26 | override fun initView() {
27 | mRecyclerView = findViewById(R.id.recycler_view)
28 | }
29 |
30 | override fun initData() {
31 | mNavigationBuilder!!.setTitleText("LinearLayoutManager实现悬浮").create()
32 | mGroupBeans = instance.data.toMutableList()
33 | val itemDecoration = SuspenisonItemDecoration.Builder(this, mGroupBeans)
34 | .setTextCenter(true).create()
35 | val suspenisonItemDecoration = SuspenisonItemDecoration(this, mGroupBeans)
36 | mRecyclerView!!.addItemDecoration(itemDecoration!!)
37 | mGroupAdapter = GroupLinearAdapter(this, mGroupBeans)
38 | mRecyclerView!!.adapter = mGroupAdapter
39 | }
40 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/activity/home/recylcer/bean/GroupBean.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.activity.home.recylcer.bean
2 |
3 | import com.peakmain.ui.recyclerview.group.GroupRecyclerBean
4 |
5 | /**
6 | * author :Peakmain
7 | * createTime:2020/3/22
8 | * mail:2726449200@qq.com
9 | * describe:
10 | */
11 | class GroupBean : GroupRecyclerBean {
12 | var url: String? = null
13 | var time: String? = null
14 |
15 | constructor(isHeader: Boolean, header: String?) : super(isHeader, header)
16 | constructor(url: String?, time: String?) {
17 | this.url = url
18 | this.time = time
19 | }
20 |
21 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/activity/home/recylcer/itemDecoration/SuspenisonItemDecoration.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.activity.home.recylcer.itemDecoration
2 |
3 | import android.content.Context
4 | import com.peakmain.basicui.activity.home.recylcer.bean.GroupBean
5 | import com.peakmain.ui.recyclerview.itemdecoration.BaseSuspenisonItemDecoration
6 |
7 | /**
8 | * author :Peakmain
9 | * createTime:2020/3/23
10 | * mail:2726449200@qq.com
11 | * describe:
12 | */
13 | class SuspenisonItemDecoration : BaseSuspenisonItemDecoration {
14 | constructor(builder: BaseSuspenisonItemDecoration.Builder) : super(builder)
15 | constructor(context: Context?, data: List?) : super(context, data!!)
16 |
17 | override fun getTopText(data: List?, position: Int): String? {
18 | return data!![position]?.time
19 | }
20 |
21 | class Builder(context: Context?, data: List?) : BaseSuspenisonItemDecoration.Builder(context!!, data!!) {
22 | override fun create(): BaseSuspenisonItemDecoration<*> {
23 | return SuspenisonItemDecoration(this)
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/activity/home/recylcer/itemTouchHelper/GridItemTouchHelper.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.activity.home.recylcer.itemTouchHelper
2 |
3 | import androidx.recyclerview.widget.RecyclerView
4 | import com.peakmain.basicui.activity.home.recylcer.bean.GroupBean
5 | import com.peakmain.ui.recyclerview.adapter.ViewHolder
6 | import com.peakmain.ui.recyclerview.itemtouch.BaseItemTouchHelper
7 |
8 | /**
9 | * author :Peakmain
10 | * createTime:2020/3/25
11 | * mail:2726449200@qq.com
12 | * describe:
13 | */
14 | class GridItemTouchHelper(adapter: RecyclerView.Adapter?, data: List?) : BaseItemTouchHelper(adapter, data)
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/activity/utils/LogActivity.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.activity.utils;
2 |
3 | import android.widget.Button;
4 |
5 | import com.peakmain.basicui.R;
6 | import com.peakmain.basicui.base.BaseActivity;
7 | import com.peakmain.ui.utils.log.LogManager;
8 | import com.peakmain.ui.utils.log.PLog;
9 |
10 | /**
11 | * author :Peakmain
12 | * createTime:2021/3/14
13 | * mail:2726449200@qq.com
14 | * describe:
15 | */
16 | public class LogActivity extends BaseActivity {
17 |
18 | private Button mBtnPrintLog;
19 |
20 |
21 | @Override
22 | protected int getLayoutId() {
23 | return R.layout.activity_log_view;
24 |
25 | }
26 |
27 | @Override
28 | protected void initView() {
29 | mBtnPrintLog = findViewById(R.id.btn_print_log);
30 | LogManager.getInstance().showPrintView(this);
31 | mBtnPrintLog.setOnClickListener(v -> {
32 | PLog.e("测试打印");
33 | });
34 | }
35 |
36 | @Override
37 | protected void initData() {
38 |
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/adapter/BaseRecyclerStringAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.adapter
2 |
3 | import android.content.Context
4 | import com.peakmain.basicui.R
5 | import com.peakmain.ui.recyclerview.adapter.CommonRecyclerAdapter
6 | import com.peakmain.ui.recyclerview.adapter.ViewHolder
7 |
8 | /**
9 | * author :Peakmain
10 | * createTime:2020/3/9
11 | * mail:2726449200@qq.com
12 | * describe:
13 | */
14 | class BaseRecyclerStringAdapter(context: Context?, data: List) : CommonRecyclerAdapter(context, data, R.layout.item_recyclerview_home) {
15 | override fun convert(holder: ViewHolder, item: String) {
16 | holder.setText(R.id.tv_title, item)
17 | }
18 |
19 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/adapter/GroupGridAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.adapter
2 |
3 | import android.content.Context
4 | import android.widget.ImageView
5 | import com.peakmain.basicui.R
6 | import com.peakmain.basicui.activity.home.recylcer.bean.GroupBean
7 | import com.peakmain.ui.imageLoader.ImageLoader.Companion.instance
8 | import com.peakmain.ui.recyclerview.adapter.ViewHolder
9 | import com.peakmain.ui.recyclerview.group.BaseGridGroupRecyclerAdapter
10 |
11 | /**
12 | * author :Peakmain
13 | * createTime:2020/3/22
14 | * mail:2726449200@qq.com
15 | * describe:
16 | */
17 | class GroupGridAdapter(var context: Context, data: List?) :
18 | BaseGridGroupRecyclerAdapter(context, data, R.layout.item_recycler_group) {
19 | override fun convert(holder: ViewHolder, item: GroupBean) {
20 | val imageView = holder.getView(R.id.iv_image)
21 | instance.displayImage(item.url!!, imageView, 0)
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/adapter/GroupLinearAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.adapter
2 |
3 | import android.content.Context
4 | import android.widget.ImageView
5 | import com.peakmain.basicui.R
6 | import com.peakmain.basicui.activity.home.recylcer.bean.GroupBean
7 | import com.peakmain.ui.imageLoader.ImageLoader.Companion.instance
8 | import com.peakmain.ui.recyclerview.adapter.ViewHolder
9 | import com.peakmain.ui.recyclerview.group.BaseGroupRecyclerAdapter
10 |
11 | /**
12 | * author :Peakmain
13 | * createTime:2020/3/22
14 | * mail:2726449200@qq.com
15 | * describe:
16 | */
17 | class GroupLinearAdapter(context: Context?, data: MutableList) : BaseGroupRecyclerAdapter(context, data, R.layout.item_recycler_group, R.layout.item_group_head) {
18 | override fun convertHead(holder: ViewHolder, item: GroupBean?) {
19 | holder.setText(R.id.tv_index, item?.header)
20 | }
21 |
22 | override fun convert(holder: ViewHolder, item: GroupBean) {
23 | val imageView = holder.getView(R.id.iv_image)
24 | instance.displayImage( item.url!!, imageView, 0)
25 | }
26 |
27 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/adapter/MenuBrandAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.adapter
2 |
3 | import android.content.Context
4 | import com.peakmain.basicui.R
5 | import com.peakmain.ui.recyclerview.adapter.CommonRecyclerAdapter
6 | import com.peakmain.ui.recyclerview.adapter.ViewHolder
7 |
8 | /**
9 | * author :Peakmain
10 | * createTime:2023/04/14
11 | * mail:2726449200@qq.com
12 | * describe:
13 | */
14 | class MenuBrandAdapter(context: Context?, data: MutableList) :
15 | CommonRecyclerAdapter(context, data, R.layout.item_recycler_menu_brand) {
16 | override fun convert(holder: ViewHolder, item: String) {
17 | holder.setText(R.id.tv_brand, item)
18 | }
19 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/adapter/MenuHotCityAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.adapter
2 |
3 | import android.content.Context
4 | import com.peakmain.basicui.R
5 | import com.peakmain.ui.recyclerview.adapter.CommonRecyclerAdapter
6 | import com.peakmain.ui.recyclerview.adapter.ViewHolder
7 |
8 | /**
9 | * author :Peakmain
10 | * createTime:2023/04/14
11 | * mail:2726449200@qq.com
12 | * describe:
13 | */
14 | class MenuHotCityAdapter(context: Context?, data: MutableList) :
15 | CommonRecyclerAdapter(context, data, R.layout.item_recycler_menu_hot_city) {
16 | override fun convert(holder: ViewHolder, item: String) {
17 | holder.setText(R.id.tv_city, item)
18 | }
19 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/adapter/MenuLeftRecyclerAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.adapter
2 |
3 | import android.content.Context
4 | import android.graphics.Color
5 | import android.util.TypedValue
6 | import android.widget.TextView
7 | import com.peakmain.basicui.R
8 | import com.peakmain.ui.recyclerview.adapter.CommonRecyclerAdapter
9 | import com.peakmain.ui.recyclerview.adapter.ViewHolder
10 |
11 | /**
12 | * author :Peakmain
13 | * createTime:2020/3/9
14 | * mail:2726449200@qq.com
15 | * describe:
16 | */
17 | class MenuLeftRecyclerAdapter(context: Context?, data: List) :
18 | CommonRecyclerAdapter(context, data, R.layout.item_recyclerview_home) {
19 | @JvmField
20 | var mSelectPosition = 0
21 |
22 | @JvmField
23 | var mOldSelectPosition = mSelectPosition
24 | override fun convert(holder: ViewHolder, item: String) {
25 | holder.setText(R.id.tv_title, item)
26 | val textView = holder.getView(R.id.tv_title)
27 | textView
28 | ?.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14f)
29 | if (holder.absoluteAdapterPosition == mSelectPosition) {
30 | textView?.setTextColor(Color.parseColor("#6CBD9B"))
31 | } else {
32 | textView?.setTextColor(Color.parseColor("#272A2B"))
33 | }
34 | }
35 |
36 | fun setSelectItem(position: Int) {
37 | mSelectPosition = position
38 | notifyItemChanged(mOldSelectPosition)
39 | notifyItemChanged(mSelectPosition)
40 | mOldSelectPosition = position
41 | }
42 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/adapter/MenuSubCategroyRightRecyclerAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.adapter
2 |
3 | import android.content.Context
4 | import com.peakmain.basicui.R
5 | import com.peakmain.ui.recyclerview.adapter.CommonRecyclerAdapter
6 | import com.peakmain.ui.recyclerview.adapter.ViewHolder
7 |
8 | /**
9 | * author :Peakmain
10 | * createTime:2020/3/9
11 | * mail:2726449200@qq.com
12 | * describe:
13 | */
14 | class MenuSubCategroyRightRecyclerAdapter(context: Context?, data: List) :
15 | CommonRecyclerAdapter(context, data, R.layout.item_recyclerview_categropy_sub) {
16 | override fun convert(holder: ViewHolder, item: String) {
17 | holder.setText(R.id.tv_title, item)
18 | }
19 |
20 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/adapter/MenuSubRightRecyclerAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.adapter
2 |
3 | import android.content.Context
4 | import android.view.View
5 | import androidx.recyclerview.widget.GridLayoutManager
6 | import androidx.recyclerview.widget.RecyclerView
7 | import com.peakmain.basicui.R
8 | import com.peakmain.basicui.bean.CategoryRightSubBean
9 | import com.peakmain.ui.recyclerview.adapter.CommonRecyclerAdapter
10 | import com.peakmain.ui.recyclerview.adapter.ViewHolder
11 |
12 | /**
13 | * author :Peakmain
14 | * createTime:2020/3/9
15 | * mail:2726449200@qq.com
16 | * describe:
17 | */
18 | class MenuSubRightRecyclerAdapter(context: Context?, data: MutableList) :
19 | CommonRecyclerAdapter(
20 | context,
21 | data,
22 | R.layout.item_recycler_menu_categroy_right_sub
23 | ) {
24 | override fun convert(holder: ViewHolder, item: CategoryRightSubBean) {
25 | holder.setText(R.id.tv_sub_title, item.subTitle)
26 | val recyclerView = holder.getView(R.id.rv_content)
27 | (recyclerView?.layoutManager as GridLayoutManager).spanSizeLookup =
28 | ThreeColumnSpanSizeLookup()
29 | recyclerView.adapter = MenuSubCategroyRightRecyclerAdapter(mContext, item.activityList)
30 | if(holder.bindingAdapterPosition==0){
31 | holder.setViewVisibility(R.id.view, View.GONE)
32 | }else{
33 | holder.setViewVisibility(R.id.view, View.VISIBLE)
34 | }
35 | }
36 |
37 | }
38 |
39 | class ThreeColumnSpanSizeLookup : GridLayoutManager.SpanSizeLookup() {
40 | override fun getSpanSize(position: Int): Int {
41 | return 1
42 | }
43 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/adapter/MultiTypeRecyclerAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.adapter
2 |
3 | import android.content.Context
4 | import com.peakmain.basicui.R
5 | import com.peakmain.ui.imageLoader.ImageLoader
6 | import com.peakmain.ui.recyclerview.adapter.CommonRecyclerAdapter
7 | import com.peakmain.ui.recyclerview.adapter.MultiTypeSupport
8 | import com.peakmain.ui.recyclerview.adapter.ViewHolder
9 |
10 | /**
11 | * author :Peakmain
12 | * createTime:2021/9/27
13 | * mail:2726449200@qq.com
14 | * describe:
15 | */
16 | class MultiTypeRecyclerAdapter(context: Context?, data: MutableList) : CommonRecyclerAdapter(context, data, multiTypeSupport=object :MultiTypeSupport{
17 | override fun getLayoutId(item: String, position: Int): Int {
18 | if(position%2==0&&position%3!=0){
19 | return R.layout.item_recyclerview_home
20 | }else if(position%3==0){
21 | return R.layout.recycler_view_image
22 | }
23 | return R.layout.item_flow_layout
24 | }
25 | }){
26 | override fun convert(holder: ViewHolder, item: String) {
27 | val position = holder.adapterPosition
28 | when {
29 | position%2==0&&position%3!=0 -> {
30 | holder.setText(R.id.tv_title,item)
31 | }
32 | position%3==0 -> {
33 | ImageLoader.instance.displayImage(item,holder.getView(R.id.iv_image))
34 | }
35 | else -> {
36 | holder.setText(R.id.tv_label,item)
37 | }
38 | }
39 | }
40 |
41 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/bean/CategoryRightSubBean.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.bean
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2023/04/17
6 | * mail:2726449200@qq.com
7 | * describe:
8 | */
9 | data class CategoryRightSubBean(val subTitle:String, val activityList:List)
10 |
11 | data class CategoryRightBean(var title:String="", var categoryRightBeans: ArrayList)
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/bean/Person.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.bean
2 |
3 | class Person {
4 | var age = 0
5 | lateinit var name: String
6 |
7 | constructor()
8 | constructor(name: String, age: Int) {
9 | this.age = age
10 | this.name = name
11 | }
12 |
13 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/fragment/ItemFragment.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.fragment
2 |
3 | import android.os.Bundle
4 | import android.view.LayoutInflater
5 | import android.view.View
6 | import android.view.ViewGroup
7 | import android.widget.TextView
8 | import androidx.fragment.app.Fragment
9 | import com.peakmain.basicui.R
10 |
11 | /**
12 | * author :Peakmain
13 | * createTime:2020/3/11
14 | * mail:2726449200@qq.com
15 | * describe:
16 | */
17 | class ItemFragment : Fragment() {
18 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
19 | val view = inflater.inflate(R.layout.fragment_item, container, false)
20 | val tv = view.findViewById(R.id.text_view1)
21 | val bundle = arguments
22 | tv.text = bundle!!.getString("title")
23 | return view
24 | }
25 |
26 | companion object {
27 | fun newInstance(item: String?): ItemFragment {
28 | val itemFragment = ItemFragment()
29 | val bundle = Bundle()
30 | bundle.putString("title", item)
31 | itemFragment.arguments = bundle
32 | return itemFragment
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/fragment/MineFragment.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.fragment
2 |
3 | import android.view.View
4 | import com.peakmain.basicui.R
5 | import com.peakmain.basicui.base.BaseFragmnet
6 | import com.peakmain.ui.navigationbar.DefaultNavigationBar
7 |
8 | /**
9 | * author :Peakmain
10 | * createTime:2020/3/9
11 | * mail:2726449200@qq.com
12 | * describe:
13 | */
14 | class MineFragment : BaseFragmnet() {
15 | override val layoutId: Int
16 | get() = R.layout.fragment_mine
17 |
18 | override fun initView(view: View?) {
19 | DefaultNavigationBar.Builder(context, view?.findViewById(R.id.view_root))
20 | .hideLeftText()
21 | .hideRightView()
22 | .setTitleText("我的")
23 | .setToolbarBackgroundColor(R.color.ui_color_01a8e3)
24 | .create()
25 | }
26 |
27 | override fun initData() {}
28 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/launcher/AMapTask.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.launcher
2 |
3 | import com.peakmain.ui.utils.launcher.task.Task
4 |
5 | /**
6 | * author :Peakmain
7 | * createTime:2020/12/10
8 | * mail:2726449200@qq.com
9 | * describe:
10 | */
11 | class AMapTask : Task() {
12 | /* private var mLocationClient: AMapLocationClient? = null
13 | private var mLocationOption: AMapLocationClientOption? = null
14 | private val mLocationListener = AMapLocationListener {
15 | // 一些处理
16 | }*/
17 |
18 | override fun run() {
19 | /* mLocationClient = AMapLocationClient(mContext)
20 | mLocationClient!!.setLocationListener(mLocationListener)
21 | mLocationOption = AMapLocationClientOption()
22 | mLocationOption!!.locationMode = AMapLocationClientOption.AMapLocationMode.Battery_Saving
23 | mLocationOption!!.isOnceLocation = true
24 | mLocationClient!!.setLocationOption(mLocationOption)
25 | mLocationClient!!.startLocation()*/
26 | }
27 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/launcher/DeviceIdTask.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.launcher
2 |
3 | import android.Manifest
4 | import android.content.Context
5 | import android.content.pm.PackageManager
6 | import android.telephony.TelephonyManager
7 | import androidx.core.app.ActivityCompat
8 | import com.peakmain.basicui.App
9 | import com.peakmain.ui.utils.launcher.task.Task
10 |
11 | /**
12 | * author :Peakmain
13 | * createTime:2020/12/10
14 | * mail:2726449200@qq.com
15 | * describe:
16 | */
17 | class DeviceIdTask : Task() {
18 | private var mDeviceId: String? = null
19 | override fun run() {
20 | // 真正自己的代码
21 | val tManager = mContext?.getSystemService(
22 | Context.TELEPHONY_SERVICE) as TelephonyManager
23 | if (ActivityCompat.checkSelfPermission(mContext!!, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
24 | return
25 | }
26 | mDeviceId = tManager.deviceId
27 | val app = mContext as App?
28 | app?.deviceId = mDeviceId
29 | }
30 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/launcher/JPushTask.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.launcher
2 |
3 | import com.peakmain.basicui.App
4 | import com.peakmain.ui.utils.LogUtils
5 | import com.peakmain.ui.utils.launcher.task.Task
6 | import java.util.*
7 |
8 | /**
9 | * author :Peakmain
10 | * createTime:2020/12/10
11 | * mail:2726449200@qq.com
12 | * describe:
13 | */
14 | class JPushTask : Task() {
15 | override fun dependsOn(): List?> {
16 | val tasks: MutableList?> = ArrayList()
17 | tasks.add(DeviceIdTask::class.java)
18 | return tasks
19 | }
20 |
21 | override fun run() {
22 | //模拟极光推送
23 | LogUtils.e("极光推送开始")
24 | val app = mContext as App?
25 | LogUtils.e("极光推送获取id:", app?.deviceId)
26 | }
27 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/launcher/UtilsTask.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.launcher
2 |
3 | import android.R
4 | import android.view.Gravity
5 | import androidx.core.content.ContextCompat
6 | import com.peakmain.ui.utils.ToastUtils
7 | import com.peakmain.ui.utils.launcher.task.Task
8 |
9 | /**
10 | * author :Peakmain
11 | * createTime:2020/12/10
12 | * mail:2726449200@qq.com
13 | * describe:
14 | */
15 | class UtilsTask : Task() {
16 | override fun run() {
17 | ToastUtils.setBgColor(ContextCompat.getColor(mContext!!, R.color.transparent))
18 | ToastUtils.setGravity(Gravity.CENTER, 0, 0)
19 | ToastUtils.setMsgColor(ContextCompat.getColor(mContext!!, com.peakmain.basicui.R.color.ui_color_01a8e3))
20 | }
21 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/launcher/WeexTask.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.launcher
2 |
3 | import com.peakmain.ui.utils.launcher.task.MainTask
4 |
5 | /**
6 | * author :Peakmain
7 | * createTime:2020/12/10
8 | * mail:2726449200@qq.com
9 | * describe:
10 | */
11 | class WeexTask : MainTask() {
12 | override fun run() {
13 | /* InitConfig config = new InitConfig.Builder().build();
14 | WXSDKEngine.initialize((Application) mContext, config);*/
15 | }
16 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/view/RadioCancelButton.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.view
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import androidx.appcompat.R
6 | import androidx.appcompat.widget.AppCompatRadioButton
7 |
8 | /**
9 | * author :Peakmain
10 | * createTime:2020/3/10
11 | * mail:2726449200@qq.com
12 | * describe:
13 | */
14 | class RadioCancelButton @JvmOverloads constructor(context: Context?, attrs: AttributeSet?=null, defStyleAttr: Int= R.attr.radioButtonStyle) :
15 | AppCompatRadioButton(context,attrs, defStyleAttr){
16 | override fun toggle() {
17 | isChecked = !isChecked
18 | }
19 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/peakmain/basicui/view/TableLayout.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui.view
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import com.peakmain.ui.tablayout.BaseTabLayout
6 |
7 | /**
8 | * author :Peakmain
9 | * createTime:2020/3/11
10 | * mail:2726449200@qq.com
11 | * describe:
12 | */
13 | class TableLayout @JvmOverloads constructor(
14 | context: Context,
15 | attrs: AttributeSet? = null,
16 | defStyleAttr: Int = 0
17 | ) : BaseTabLayout(context, attrs, defStyleAttr) {
18 | override fun setTableTitle(bean: List?, position: Int): String {
19 | return bean!![position]
20 | }
21 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/bg_lable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/src/main/res/drawable-hdpi/bg_lable.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/bg_lable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/src/main/res/drawable-xhdpi/bg_lable.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/list_view_pull.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/src/main/res/drawable-xhdpi/list_view_pull.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/list_view_refreshing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/src/main/res/drawable-xhdpi/list_view_refreshing.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/list_view_refreshing_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/src/main/res/drawable-xhdpi/list_view_refreshing_1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/list_view_refreshing_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/src/main/res/drawable-xhdpi/list_view_refreshing_2.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/list_view_release.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/src/main/res/drawable-xhdpi/list_view_release.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/atour.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_lable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/src/main/res/drawable/bg_lable.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/check_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bottom_navigation_home.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bottom_navigation_me.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bottom_navigation_utils.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_password_hide.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_password_show.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_triangle_down.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_triangle_up.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/load_more_anim.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
11 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/src/main/res/drawable/logo.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/select_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_tab_color.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity/layout/activity_custom_id.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity/layout/activity_custom_keyboard_point.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity/layout/activity_image_compress.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
22 |
28 |
29 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity/layout/activity_image_select.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
22 |
23 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity/layout/activity_lock_pattern.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity/layout/activity_menu_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
22 |
23 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity/layout/activity_pop_window_flow.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
17 |
18 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity/layout/activity_shape_loading.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
20 |
21 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity/layout/activity_table_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
20 |
21 |
22 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity/layout/activity_text_utils.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
18 |
24 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity/layout/menu_list_sub_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_log_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/basic_grid_recycler_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/basic_head_foot_recycler_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/basic_load_refresh_recycler_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog/layout/dialog_bitmap_utils.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog/layout/dialog_constraintlayout.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
21 |
22 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog/layout/dialog_custom_keyboard_point.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog/layout/dialog_dowload_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment/layout/fragment_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment/layout/fragment_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment/layout/fragment_mine.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
24 |
33 |
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment/layout/fragment_utils.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_flow_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_group_head.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_label_popwindow_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_recycler_group.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_recycler_menu_brand.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
19 |
20 |
21 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_recycler_menu_categroy_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
20 |
21 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_recycler_menu_categroy_right_sub.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
21 |
22 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_recycler_menu_hot_city.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_recycler_menu_recommend_sort.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
14 |
20 |
21 |
25 |
26 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_recyclerview_categropy_sub.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_recyclerview_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout__bestmiss_refresh_header_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_load_footer_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
13 |
14 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_menu_recommend_sort.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/recycler_view_image.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/suspend_recycler_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/ui_list_data_screen_menu_100.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/ui_list_data_screen_tab.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
17 |
18 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/ui_list_menu_content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_header_footer.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/bottom_navigation_main.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/src/main/res/mipmap-hdpi/ic_launcher.jpg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/src/main/res/mipmap-mdpi/ic_launcher.jpg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/src/main/res/mipmap-xhdpi/ic_launcher.jpg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_default_portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/src/main/res/mipmap-xxhdpi/ic_default_portrait.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/src/main/res/mipmap-xxhdpi/ic_launcher.jpg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/list_load_more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/app/src/main/res/mipmap-xxhdpi/list_load_more.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #921241
6 | #D81B60
7 | #FFFFFF
8 | #F117D4
9 | #d1d1d1
10 | #F5F5F5
11 | #7D7D7D
12 | #999999
13 | #272A2B
14 | #6CBD9B
15 | #003A40
16 | #d4d4d5
17 | #f1f4f6
18 | #01a8e3
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16sp
4 | 10dp
5 | 20dp
6 | 50dp
7 | 1dp
8 | 6dp
9 | 5dp
10 | 88dp
11 | 14sp
12 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/test/java/com/peakmain/basicui/AppTest.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.basicui
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2023/04/19
6 | * mail:2726449200@qq.com
7 | * describe:
8 | */
9 | class AppTest
--------------------------------------------------------------------------------
/basicuUI.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/basicuUI.keystore
--------------------------------------------------------------------------------
/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.6.10'
5 | repositories {
6 | google()
7 | jcenter()
8 | maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
9 |
10 | }
11 | dependencies {
12 | classpath 'com.android.tools.build:gradle:4.2.2'
13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14 |
15 |
16 | // NOTE: Do not place your application dependencies here; they belong
17 | // in the individual module build.gradle files
18 | }
19 | }
20 |
21 | allprojects {
22 | repositories {
23 | google()
24 | jcenter()
25 | maven { url "https://jitpack.io" }
26 | }
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/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 | android.injected.testOnly=false
21 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Dec 04 16:52:51 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-6.7.1-all.zip
7 |
--------------------------------------------------------------------------------
/jitpack.yml:
--------------------------------------------------------------------------------
1 | jdk:
2 | - openjdk8
3 | before_install:
4 | - yes | sdkmanager --install "ndk;21.0.6113669"
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':ui'
2 | rootProject.name = 'BasicUI'
3 |
--------------------------------------------------------------------------------
/ui/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/ui/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.4.1)
2 |
3 | if (CMAKE_COMPILER_IS_GNUCXX)
4 | set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
5 | message(STATUS "optional:-std=c++11")
6 | endif (CMAKE_COMPILER_IS_GNUCXX)
7 |
8 | set(libjpeg_dir ${CMAKE_SOURCE_DIR}/libjpeg)
9 | set(INC_DIR ${libjpeg_dir}/jpeg)
10 | set(libjpeg_lib_dir ${libjpeg_dir}/so)
11 |
12 | #添加头文件目录
13 | include_directories(${INC_DIR})
14 | include_directories("src/main/cpp/include/gif")
15 |
16 | #指定源文件的目录
17 | set(source_dir src/main/cpp/src)
18 | aux_source_directory(${source_dir} src_list)
19 | aux_source_directory(${source_dir}/gif src_list)
20 |
21 |
22 | add_library(compress-lib
23 | SHARED
24 | src/main/cpp/compress-lib.cpp
25 | ${src_list})
26 |
27 | find_library(graphics jnigraphics)
28 |
29 | add_library(libjpeg SHARED IMPORTED)
30 | set_target_properties(libjpeg
31 | PROPERTIES IMPORTED_LOCATION
32 | ${libjpeg_lib_dir}/${ANDROID_ABI}/libjpeg.so)
33 |
34 | find_library(log-lib
35 | log)
36 |
37 | target_link_libraries(compress-lib
38 | libjpeg
39 | ${log-lib}
40 | ${graphics})
--------------------------------------------------------------------------------
/ui/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/ui/consumer-rules.pro
--------------------------------------------------------------------------------
/ui/libjpeg/jpeg/jversion.h:
--------------------------------------------------------------------------------
1 | /*
2 | * jversion.h
3 | *
4 | * Copyright (C) 1991-2010, Thomas G. Lane, Guido Vollbeding.
5 | * Copyright (C) 2010, D. R. Commander.
6 | * This file is part of the Independent JPEG Group's software.
7 | * For conditions of distribution and use, see the accompanying README file.
8 | *
9 | * This file contains software version identification.
10 | */
11 |
12 |
13 | #if JPEG_LIB_VERSION >= 80
14 |
15 | #define JVERSION "8b 16-May-2010"
16 |
17 | #define JCOPYRIGHT "Copyright (C) 2010, Thomas G. Lane, Guido Vollbeding"
18 |
19 | #elif JPEG_LIB_VERSION >= 70
20 |
21 | #define JVERSION "7 27-Jun-2009"
22 |
23 | #define JCOPYRIGHT "Copyright (C) 2009, Thomas G. Lane, Guido Vollbeding"
24 |
25 | #else
26 |
27 | #define JVERSION "6b 27-Mar-1998"
28 |
29 | #define JCOPYRIGHT "Copyright (C) 1998, Thomas G. Lane"
30 |
31 | #endif
32 |
33 | #define LJTCOPYRIGHT "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \
34 | "Copyright (C) 2009 Pierre Ossman for Cendio AB\n" \
35 | "Copyright (C) 2009-2011 D. R. Commander\n" \
36 | "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)"
37 |
--------------------------------------------------------------------------------
/ui/libjpeg/so/arm64-v8a/libjpeg.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/ui/libjpeg/so/arm64-v8a/libjpeg.so
--------------------------------------------------------------------------------
/ui/libjpeg/so/armeabi-v7a/libjpeg.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/ui/libjpeg/so/armeabi-v7a/libjpeg.so
--------------------------------------------------------------------------------
/ui/libjpeg/so/x86/libjpeg.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Peakmain/BasicUI/2858039196fc788f66c3a79498bdcaffccf1fe64/ui/libjpeg/so/x86/libjpeg.so
--------------------------------------------------------------------------------
/ui/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 |
--------------------------------------------------------------------------------
/ui/src/androidTest/java/com/peakmain/ui/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("com.peakmain.ui.test", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/ui/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
12 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/ui/src/main/cpp/include/gif/gif_hash.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 |
3 | gif_hash.h - magfic constants and declarations for GIF LZW
4 |
5 | ******************************************************************************/
6 |
7 | #ifndef _GIF_HASH_H_
8 | #define _GIF_HASH_H_
9 |
10 | #include
11 | #include
12 |
13 | #define HT_SIZE 8192 /* 12bits = 4096 or twice as big! */
14 | #define HT_KEY_MASK 0x1FFF /* 13bits keys */
15 | #define HT_KEY_NUM_BITS 13 /* 13bits keys */
16 | #define HT_MAX_KEY 8191 /* 13bits - 1, maximal code possible */
17 | #define HT_MAX_CODE 4095 /* Biggest code possible in 12 bits. */
18 |
19 | /* The 32 bits of the long are divided into two parts for the key & code: */
20 | /* 1. The code is 12 bits as our compression algorithm is limited to 12bits */
21 | /* 2. The key is 12 bits Prefix code + 8 bit new char or 20 bits. */
22 | /* The key is the upper 20 bits. The code is the lower 12. */
23 | #define HT_GET_KEY(l) (l >> 12)
24 | #define HT_GET_CODE(l) (l & 0x0FFF)
25 | #define HT_PUT_KEY(l) (l << 12)
26 | #define HT_PUT_CODE(l) (l & 0x0FFF)
27 |
28 | typedef struct GifHashTableType {
29 | uint32_t HTable[HT_SIZE];
30 | } GifHashTableType;
31 |
32 | GifHashTableType *_InitHashTable(void);
33 | void _ClearHashTable(GifHashTableType *HashTable);
34 | void _InsertHashTable(GifHashTableType *HashTable, uint32_t Key, int Code);
35 | int _ExistsHashTable(GifHashTableType *HashTable, uint32_t Key);
36 |
37 | #endif /* _GIF_HASH_H_ */
38 |
39 | /* end */
40 |
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/BasicUIProvider.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui
2 |
3 | import android.app.Application
4 | import androidx.core.content.FileProvider
5 | import com.peakmain.ui.constants.BasicUIUtils
6 |
7 | /**
8 | * author :Peakmain
9 | * createTime:2020/12/24
10 | * mail:2726449200@qq.com
11 | * describe:
12 | */
13 | class BasicUIProvider : FileProvider() {
14 | override fun onCreate(): Boolean {
15 | BasicUIUtils.init(context?.applicationContext as Application?)
16 | return true
17 | }
18 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/adapter/BaseAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.adapter
2 |
3 | import android.view.View
4 | import android.view.ViewGroup
5 |
6 | /**
7 | * author :Peakmain
8 | * createTime:2020/3/4
9 | * mail:2726449200@qq.com
10 | * describe:
11 | */
12 | abstract class BaseAdapter {
13 | /**
14 | * 1.多少item数量
15 | */
16 | abstract val count: Int
17 |
18 | /**
19 | * 2.获取view通过position
20 | */
21 | abstract fun getView(position: Int, parent: ViewGroup?): View?
22 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/adapter/flow/BaseFlowAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.adapter.flow
2 |
3 | import com.peakmain.ui.adapter.BaseAdapter
4 |
5 | /**
6 | * author: peakmain
7 | * create:2019/7/16
8 | * mail: 2726449200@qq.com
9 | * description:流式布局的基本适配器
10 | */
11 | abstract class BaseFlowAdapter : BaseAdapter() {
12 | private var mObserver: FlowObserver? = null
13 |
14 | //3.观察者模式及时更新
15 | fun unregisterDataSetObserver() {
16 | mObserver = null
17 | }
18 |
19 | fun registerDataSetObserver(observer: FlowObserver?) {
20 | mObserver = observer
21 | }
22 |
23 | fun notifyDataChange() {
24 | if (mObserver != null) {
25 | mObserver!!.notifyDataChange()
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/adapter/flow/FlowObserver.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.adapter.flow
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2020/3/5
6 | * mail:2726449200@qq.com
7 | * describe:流式布局的观察者
8 | */
9 | abstract class FlowObserver {
10 | abstract fun notifyDataChange()
11 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/adapter/menu/BaseMenuAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.adapter.menu
2 |
3 | import android.view.View
4 | import android.view.ViewGroup
5 | import android.widget.LinearLayout
6 | import com.peakmain.ui.adapter.BaseAdapter
7 |
8 | /**
9 | * author :Peakmain
10 | * createTime:2020/3/4
11 | * mail:2726449200@qq.com
12 | * describe:多条目菜单筛选的适配器
13 | */
14 | abstract class BaseMenuAdapter : BaseAdapter() {
15 | //订阅用户放到这个集合
16 | private var mObserver: MenuObserver? = null
17 |
18 | /**
19 | * 订阅注册
20 | */
21 | fun registerDataSetObserver(observer: MenuObserver?) {
22 | mObserver = observer
23 | }
24 |
25 | /**
26 | * 解注册
27 | */
28 | fun unregisterDataSetObserver() {
29 | mObserver = null
30 | }
31 |
32 | fun closeMenu() {
33 | if (mObserver != null) {
34 | mObserver!!.closeMenu()
35 | }
36 | }
37 |
38 | /**
39 | * 获取Menu的view
40 | */
41 | abstract fun getMenuView(position: Int, parent: ViewGroup): View
42 |
43 | /**
44 | * 打开菜单
45 | */
46 | abstract fun openMenu(menuTabView: LinearLayout?, tabView: View)
47 |
48 | /**
49 | * 关闭菜单
50 | * @param menuTabView 所有的Tab View
51 | * @param tabView 当前 tabView
52 | * @param position 当前tabView的position
53 | * @param isSwitch 是否是点击切换
54 | */
55 | abstract fun closeMenu(menuTabView: LinearLayout, tabView: View, position: Int, isSwitch: Boolean)
56 |
57 | /**
58 | * 阴影点击事件
59 | */
60 | open fun shadowClick(): Boolean {
61 | return false
62 | }
63 |
64 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/adapter/menu/MenuObserver.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.adapter.menu
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2020/3/5
6 | * mail:2726449200@qq.com
7 | * describe:观察者
8 | */
9 | abstract class MenuObserver {
10 | //关闭菜单
11 | abstract fun closeMenu()
12 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/compress/ImageCompute.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.compress
2 |
3 | import android.graphics.Bitmap
4 | import android.graphics.Matrix
5 | import kotlin.math.ceil
6 |
7 | /**
8 | * author :Peakmain
9 | * createTime:2020/3/27
10 | * mail:2726449200@qq.com
11 | * describe:图片等比例压缩 参考luban
12 | */
13 | object ImageCompute {
14 | @JvmStatic
15 | fun computeSize(width: Int, height: Int): Int {
16 | var srcWidth = width
17 | var srcHeight = height
18 | srcWidth = if (srcWidth % 2 == 1) srcWidth + 1 else srcWidth
19 | srcHeight = if (srcHeight % 2 == 1) srcHeight + 1 else srcHeight
20 | //拿到最大边和最小边
21 | val longSide = srcWidth.coerceAtLeast(srcHeight)
22 | val shortSide = srcWidth.coerceAtMost(srcHeight)
23 | val scale = shortSide.toFloat() / longSide
24 | return if (scale <= 1 && scale > 0.5625) {
25 | if (longSide < 1664) {
26 | 1
27 | } else if (longSide < 4990) {
28 | 2
29 | } else if (longSide in 4991..10239) {
30 | 4
31 | } else {
32 | longSide / 1280
33 | }
34 | } else if (scale <= 0.5625 && scale > 0.5) {
35 | if (longSide / 1280 == 0) 1 else longSide / 1280
36 | } else {
37 | ceil(longSide / (1280.0 / scale)).toInt()
38 | }
39 | }
40 |
41 | @JvmStatic
42 | fun rotatingImage(bitmap: Bitmap?, angle: Int): Bitmap? {
43 | val matrix = Matrix()
44 | matrix.postRotate(angle.toFloat())
45 | return if (bitmap == null) {
46 | null
47 | } else Bitmap.createBitmap(bitmap, 0, 0, bitmap.width, bitmap.height, matrix, true)
48 | }
49 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/compress/OnCompressListener.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.compress
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2020/3/28
6 | * mail:2726449200@qq.com
7 | * describe:压缩接口
8 | */
9 | interface OnCompressListener {
10 | fun onStart()
11 | fun onSuccess(list: List?)
12 | fun onError(e: Throwable?)
13 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/constants/BasicUIUtils.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.constants
2 |
3 | import android.app.Application
4 | import android.content.Context
5 | import android.view.LayoutInflater
6 | import android.view.View
7 | import androidx.annotation.LayoutRes
8 | import com.peakmain.ui.utils.LogUtils
9 |
10 | /**
11 | * author :Peakmain
12 | * createTime:2020/3/16
13 | * mail:2726449200@qq.com
14 | * describe:
15 | */
16 | object BasicUIUtils {
17 | private var mApplication: Application? = null
18 |
19 | /**
20 | * 获取布局的view
21 | *
22 | * @param context context
23 | * @param layoutId 布局的id
24 | * @return view
25 | */
26 | @JvmStatic
27 | fun getView(context: Context?, @LayoutRes layoutId: Int): View {
28 | if (context == null) {
29 | throw NullPointerException("context cannot be null")
30 | }
31 | val inflater = context.applicationContext
32 | .getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
33 | return inflater.inflate(layoutId, null)
34 | }//通过反射获取上下文
35 |
36 | /**
37 | * 获取全局上下文
38 | */
39 | @JvmStatic
40 | val application: Application?
41 | get() {
42 | if (mApplication != null) return mApplication
43 | //通过反射获取上下文
44 | init(ReflectUtils.applicationByReflect)
45 | return mApplication
46 | }
47 |
48 | fun init(application: Application?) {
49 | if (application == null) {
50 | LogUtils.e("application is null.")
51 | return
52 | }
53 | if (application != mApplication) {
54 | mApplication = application
55 | }
56 | }
57 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/dialog/ViewHelper.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.dialog
2 |
3 | import android.content.Context
4 | import android.util.SparseArray
5 | import android.view.LayoutInflater
6 | import android.view.View
7 | import android.widget.TextView
8 | import java.lang.ref.WeakReference
9 |
10 | /**
11 | * author peakmain
12 | * create:2019/7/9
13 | * mail:2726449200@qq.com
14 | * description:Layout helper classe
15 | */
16 | internal class ViewHelper() {
17 | var contentView: View? = null
18 |
19 | //The reduce findViewById
20 | private val mViews: SparseArray> = SparseArray()
21 |
22 | constructor(context: Context?, viewLayoutResId: Int) : this() {
23 | contentView = LayoutInflater.from(context).inflate(viewLayoutResId, null)
24 | }
25 |
26 | fun setText(viewId: Int, text: CharSequence?) {
27 | val textView = getView(viewId)
28 | if (textView != null) {
29 | textView.text = text
30 | }
31 | }
32 |
33 | fun setOnClickListener(viewId: Int, listener: View.OnClickListener?) {
34 | val view = getView(viewId)
35 | view?.setOnClickListener(listener)
36 | }
37 |
38 | fun getView(viewId: Int): T? {
39 | val weakReference = mViews[viewId]
40 | var view: View? = null
41 | if (weakReference != null) {
42 | view = weakReference.get()
43 | }
44 | if (view == null) {
45 | view = contentView!!.findViewById(viewId)
46 | if (view != null) {
47 | mViews.put(viewId, WeakReference(view))
48 | }
49 | }
50 | return view as T?
51 | }
52 |
53 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/image/gif/GifHelper.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.image.gif;
2 |
3 | import android.graphics.Bitmap;
4 |
5 | /**
6 | * author :Peakmain
7 | * createTime:2021/8/6
8 | * mail:2726449200@qq.com
9 | * describe:gif播放帮助类
10 | */
11 | public class GifHelper {
12 | static {
13 | System.loadLibrary("compress-lib");
14 | }
15 |
16 | private final long mGifHelper;
17 |
18 | public int getWidth() {
19 | return getWidth(mGifHelper);
20 | }
21 |
22 | public int getHeight() {
23 | return getHeight(mGifHelper);
24 | }
25 |
26 | /**
27 | * 渲染图片
28 | */
29 | public int updateFrame(Bitmap bitmap) {
30 | return updateFrame(mGifHelper, bitmap);
31 | }
32 |
33 | private GifHelper(long gifHander) {
34 | this.mGifHelper = gifHander;
35 | }
36 |
37 | public static GifHelper load(String path) {
38 | long gifHandler = loadGif(path);
39 | if (gifHandler == -1) {
40 | return null;
41 | }
42 | return new GifHelper(gifHandler);
43 | }
44 |
45 | public static native long loadGif(String path);
46 |
47 | public static native int getWidth(long gifHelper);
48 |
49 | public static native int getHeight(long gifHelper);
50 |
51 | public static native int updateFrame(long gifHelper, Bitmap bitmap);
52 | }
53 |
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/imageLoader/ImageRecyclerScrollListener.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.imageLoader
2 |
3 | import android.content.Context
4 | import androidx.recyclerview.widget.RecyclerView
5 | import com.peakmain.ui.imageLoader.ImageLoader.Companion.instance
6 |
7 | /**
8 | * author :Peakmain
9 | * createTime:2020/9/9
10 | * mail:2726449200@qq.com
11 | * describe:recyclerview在空闲的时候加载图片
12 | */
13 | class ImageRecyclerScrollListener(private val mContext: Context) : RecyclerView.OnScrollListener() {
14 | override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
15 | super.onScrollStateChanged(recyclerView, newState)
16 | //空闲的时候加载图片
17 | if (newState == RecyclerView.SCROLL_STATE_IDLE) {
18 | instance.resumeRequest(mContext)
19 | } else {
20 | instance.pauseRequest(mContext)
21 | }
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/imageLoader/factory/AbstractLoaderFactory.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.imageLoader.factory
2 |
3 | import com.peakmain.ui.imageLoader.ILoader
4 |
5 | /**
6 | * author :Peakmain
7 | * createTime:2022/7/31
8 | * mail:2726449200@qq.com
9 | * describe:
10 | */
11 | abstract class AbstractLoaderFactory {
12 | abstract fun createLoader(): ILoader
13 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/imageLoader/factory/GlideLoaderFactory.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.imageLoader.factory
2 |
3 | import com.peakmain.ui.imageLoader.ILoader
4 | import com.peakmain.ui.imageLoader.glide.GlideLoader
5 |
6 | /**
7 | * author :Peakmain
8 | * createTime:2022/7/31
9 | * mail:2726449200@qq.com
10 | * describe:
11 | */
12 | class GlideLoaderFactory : AbstractLoaderFactory() {
13 | override fun createLoader(): ILoader {
14 | return GlideLoader()
15 | }
16 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/loading/CircleView.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.loading
2 |
3 | import android.content.Context
4 | import android.graphics.Canvas
5 | import android.graphics.Paint
6 | import android.util.AttributeSet
7 | import android.view.View
8 |
9 | /**
10 | * author :Peakmain
11 | * createTime:2020/3/4
12 | * mail:2726449200@qq.com
13 | * describe:圆形的view
14 | */
15 | class CircleView @JvmOverloads constructor(
16 | context: Context?,
17 | attrs: AttributeSet? = null,
18 | defStyleAttr: Int = 0
19 | ) : View(context, attrs, defStyleAttr) {
20 | /**
21 | * 返回颜色
22 | */
23 | var color = 0
24 | private set
25 | private var mPaint: Paint = Paint()
26 |
27 | override fun onDraw(canvas: Canvas) {
28 | super.onDraw(canvas)
29 | mPaint.apply {
30 | val cx = width / 2
31 | val cy = height / 2
32 | canvas.drawCircle(cx.toFloat(), cy.toFloat(), cx.toFloat(), this)
33 | }
34 | }
35 |
36 | /**
37 | * 切换颜色
38 | */
39 | fun exchangeColor(color: Int) {
40 | this.color = color
41 | mPaint.color = this.color
42 | invalidate()
43 | }
44 |
45 | init {
46 | mPaint.isAntiAlias = true
47 | //防抖动
48 | mPaint.isDither = true
49 | }
50 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/navigationbar/INavigation.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.navigationbar
2 |
3 | import android.view.View
4 | import android.view.ViewGroup
5 |
6 | /**
7 | * author :Peakmain
8 | * createTime:2018/7/27
9 | * mail:2726449200@qq.com
10 | * describe:
11 | */
12 | interface INavigation {
13 | /**
14 | * 创建View
15 | */
16 | fun createNavigationBar()
17 |
18 | /**
19 | * 添加参数
20 | */
21 | fun attachNavigationParams()
22 | fun attachParent(navigationBarView: View?, parent: ViewGroup?)
23 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/navigationbar/NavigationBar.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.navigationbar
2 |
3 | import android.content.Context
4 | import android.view.ViewGroup
5 |
6 | /**
7 | * author :Peakmain
8 | * createTime:2018/11/26
9 | * mail:2726449200@qq.com
10 | * describe:
11 | */
12 | class NavigationBar internal constructor(builder: Builder?) :
13 | AbsNavigationBar(builder) {
14 | class Builder(context: Context?, layoutId: Int, parent: ViewGroup?) :
15 | AbsNavigationBar.Builder(context!!, layoutId, parent!!) {
16 | override fun create(): NavigationBar {
17 | return NavigationBar(this)
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/navigationbar/NavigationParameter.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.navigationbar
2 |
3 | import android.graphics.Typeface
4 | import android.view.View
5 |
6 | /**
7 | * author :Peakmain
8 | * createTime:2020-01-10
9 | * mail:2726449200@qq.com
10 | * describe:存放参数
11 | */
12 | class NavigationParameter {
13 | //控件的文本
14 | var text: CharSequence? = null
15 |
16 | //控件的点击事件
17 | var clickListener: View.OnClickListener? = null
18 |
19 | //文字颜色id的集合
20 | var textColorId = 0
21 | var typeface :Typeface= Typeface.DEFAULT
22 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/recyclerview/adapter/MultiTypeSupport.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.recyclerview.adapter
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2019/2/25
6 | * mail:2726449200@qq.com
7 | * describe:多布局支持
8 | */
9 | interface MultiTypeSupport {
10 | // 根据当前位置或者条目数据返回布局
11 | fun getLayoutId(item: T, position: Int): Int
12 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/recyclerview/creator/LoadViewCreator.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.recyclerview.creator
2 |
3 | import android.content.Context
4 | import android.view.View
5 | import android.view.ViewGroup
6 |
7 | /**
8 | * author :Peakmain
9 | * createTime:2018/11/21
10 | * mail:2726449200@qq.com
11 | * describe:
12 | */
13 | abstract class LoadViewCreator {
14 | /**
15 | * 获取上拉加载更多的View
16 | *
17 | * @param context 上下文
18 | * @param parent RecyclerView
19 | */
20 | abstract fun getLoadView(context: Context, parent: ViewGroup): View?
21 |
22 | /**
23 | * 正在上拉
24 | *
25 | * @param currentDragHeight 当前拖动的高度
26 | * @param loadViewHeight 总的加载高度
27 | * @param currentLoadStatus 当前状态
28 | */
29 | abstract fun onPull(currentDragHeight: Int, loadViewHeight: Int, currentLoadStatus: Int)
30 |
31 | /**
32 | * 正在加载中
33 | */
34 | abstract fun onLoading()
35 |
36 | /**
37 | * 停止加载
38 | */
39 | abstract fun onStopLoad()
40 |
41 | /**
42 | * 数据已经全部加载完成
43 | */
44 | abstract fun onFinishLoadData()
45 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/recyclerview/creator/RefreshViewCreator.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.recyclerview.creator
2 |
3 | import android.content.Context
4 | import android.view.View
5 | import android.view.ViewGroup
6 |
7 | /**
8 | * author :Peakmain
9 | * createTime:2018/11/21
10 | * mail:2726449200@qq.com
11 | * describe:
12 | */
13 | abstract class RefreshViewCreator {
14 | /**
15 | * 获取下拉刷新的View
16 | *
17 | * @param context 上下文
18 | * @param parent RecyclerView
19 | * @return 布局的View
20 | */
21 | abstract fun getRefreshView(context: Context, parent: ViewGroup): View?
22 |
23 | /**
24 | * 正在下拉
25 | *
26 | * @param currentDragHeight 当前拖动的高度
27 | * @param refreshViewHeight 总的刷新高度
28 | * @param currentRefreshStatus 当前状态
29 | */
30 | abstract fun onPull(currentDragHeight: Int, refreshViewHeight: Int, currentRefreshStatus: Int)
31 |
32 | /**
33 | * 正在刷新中
34 | */
35 | abstract fun onRefreshing()
36 |
37 | /**
38 | * 停止刷新
39 | */
40 | abstract fun onStopRefresh()
41 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/recyclerview/group/BaseGridGroupRecyclerAdapter.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.recyclerview.group;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.annotation.Nullable;
6 |
7 | import com.peakmain.ui.R;
8 | import com.peakmain.ui.recyclerview.adapter.ViewHolder;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * author :Peakmain
14 | * createTime:2020/3/24
15 | * mail:2726449200@qq.com
16 | * describe:GridLayoutManager悬浮的基本适配器
17 | */
18 | public abstract class BaseGridGroupRecyclerAdapter> extends BaseGroupRecyclerAdapter {
19 | public BaseGridGroupRecyclerAdapter(Context context, List data, int layoutResId) {
20 | super(context, data, layoutResId, R.layout.ui_item_recycle_group_head);
21 | }
22 |
23 | @Override
24 | protected void convertHead(@Nullable ViewHolder holder, T item) {
25 |
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/recyclerview/group/BaseGroupRecyclerAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.recyclerview.group
2 |
3 | import android.content.Context
4 | import androidx.recyclerview.widget.GridLayoutManager
5 | import androidx.recyclerview.widget.RecyclerView
6 | import com.peakmain.ui.recyclerview.adapter.CommonRecyclerAdapter
7 | import com.peakmain.ui.recyclerview.adapter.ViewHolder
8 |
9 | /**
10 | * author :Peakmain
11 | * createTime:2020/3/22
12 | * mail:2726449200@qq.com
13 | * describe:分组的recyclerview适配器
14 | */
15 | abstract class BaseGroupRecyclerAdapter?>(context: Context?, data: MutableList, layoutResId: Int, var GROUP_HEADER_VIEW: Int) : CommonRecyclerAdapter(context, data, GroupMultiType(layoutResId, GROUP_HEADER_VIEW)) {
16 | override fun onBindViewHolder(holder: ViewHolder, position: Int) {
17 | if (holder.itemViewType == GROUP_HEADER_VIEW) {
18 | convertHead(holder, getItem(position))
19 | } else {
20 | super.onBindViewHolder(holder, holder.adapterPosition)
21 | }
22 | }
23 |
24 | /**
25 | * 解决GridLayoutManager添加不占用一行的问题
26 | */
27 | fun adjustSpanSize(recyclerView: RecyclerView) {
28 | val layoutManager = recyclerView.layoutManager as GridLayoutManager
29 | layoutManager.spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
30 | override fun getSpanSize(position: Int): Int {
31 | val itemViewType = getItemViewType(position)
32 | return if (itemViewType == GROUP_HEADER_VIEW) layoutManager.spanCount else 1
33 | }
34 | }
35 | }
36 |
37 | protected abstract fun convertHead(holder: ViewHolder, item: T?)
38 |
39 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/recyclerview/group/GroupMultiType.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.recyclerview.group
2 |
3 | import com.peakmain.ui.recyclerview.adapter.MultiTypeSupport
4 |
5 | /**
6 | * author :Peakmain
7 | * createTime:2020/3/22
8 | * mail:2726449200@qq.com
9 | * describe:
10 | */
11 | internal class GroupMultiType?>(
12 | private val mLayoutResId: Int,
13 | private val mGroupHeadResId: Int
14 | ) : MultiTypeSupport {
15 | override fun getLayoutId(item: T, position: Int): Int {
16 | return if (item!!.isHeader) {
17 | mGroupHeadResId
18 | } else mLayoutResId
19 | }
20 |
21 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/recyclerview/group/GroupRecyclerBean.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.recyclerview.group
2 |
3 | import java.io.Serializable
4 |
5 | /**
6 | * author :Peakmain
7 | * createTime:2020/3/22
8 | * mail:2726449200@qq.com
9 | * describe:
10 | */
11 | open class GroupRecyclerBean : Serializable {
12 | @JvmField
13 | var isHeader = false
14 |
15 | @JvmField
16 | var header: String? = null
17 |
18 | constructor()
19 | constructor(isHeader: Boolean, header: String?) {
20 | this.isHeader = isHeader
21 | this.header = header
22 | }
23 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/recyclerview/listener/OnItemClickListener.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.recyclerview.listener
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2019/2/25
6 | * mail:2726449200@qq.com
7 | * describe:Adapter条目的点击事件
8 | */
9 | interface OnItemClickListener {
10 | fun onItemClick(position: Int)
11 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/recyclerview/listener/OnLongClickListener.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.recyclerview.listener
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2019/2/25
6 | * mail:2726449200@qq.com
7 | * describe:Adapter条目的长按事件
8 | */
9 | interface OnLongClickListener {
10 | fun onLongClick(position: Int): Boolean
11 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/recyclerview/smooth/EndSmoothScroller.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.recyclerview.smooth
2 |
3 | import android.content.Context
4 | import android.view.View
5 | import androidx.recyclerview.widget.LinearSmoothScroller
6 | import androidx.recyclerview.widget.RecyclerView
7 |
8 | /**
9 | * author :Peakmain
10 | * createTime:2023/11/1
11 | * mail:2726449200@qq.com
12 | * describe:
13 | */
14 | class EndSmoothScroller(context: Context?) : LinearSmoothScroller(context) {
15 |
16 |
17 | override fun getHorizontalSnapPreference(): Int {
18 | return SNAP_TO_END
19 | }
20 |
21 | override fun getVerticalSnapPreference(): Int {
22 | return SNAP_TO_END
23 | }
24 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/recyclerview/smooth/TopSmoothScroller.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.recyclerview.smooth
2 |
3 | import android.content.Context
4 | import android.view.View
5 | import androidx.recyclerview.widget.LinearSmoothScroller
6 | import androidx.recyclerview.widget.RecyclerView
7 |
8 | /**
9 | * author :Peakmain
10 | * createTime:2023/11/1
11 | * mail:2726449200@qq.com
12 | * describe:
13 | */
14 | class TopSmoothScroller(context: Context?) : LinearSmoothScroller(context) {
15 |
16 |
17 | override fun getHorizontalSnapPreference(): Int {
18 | return SNAP_TO_START
19 | }
20 |
21 | override fun getVerticalSnapPreference(): Int {
22 | return SNAP_TO_START
23 | }
24 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/FragmentManagerHelper.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils
2 |
3 | import androidx.fragment.app.Fragment
4 | import androidx.fragment.app.FragmentManager
5 |
6 |
7 | /**
8 | * author :Peakmain
9 | * createTime:2021/3/26
10 | * mail:2726449200@qq.com
11 | * describe:Fragment的帮助类
12 | */
13 | class FragmentManagerHelper constructor(
14 | private var mFragmentManager: FragmentManager,
15 | private var mContainerViewId: Int
16 | ) {
17 | /**
18 | * 添加fragment
19 | */
20 | fun addFragment(fragment: Fragment) {
21 | val fragmentTransaction = mFragmentManager.beginTransaction()
22 | fragmentTransaction.add(mContainerViewId, fragment)
23 | fragmentTransaction.commitAllowingStateLoss()
24 | }
25 |
26 | /**
27 | * 切换fragment
28 | */
29 | fun switchFragment(fragment: Fragment) {
30 | val fragmentTransaction = mFragmentManager.beginTransaction()
31 | val fragments = mFragmentManager.fragments
32 | fragments.forEach {
33 | fragmentTransaction.hide(it)
34 | }
35 | if (!fragments.contains(fragment)) {
36 | fragmentTransaction.add(mContainerViewId, fragment)
37 | } else {
38 | fragmentTransaction.show(fragment)
39 | }
40 | fragmentTransaction.commitAllowingStateLoss()
41 | }
42 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/MathUtils.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils
2 |
3 | import kotlin.math.abs
4 | import kotlin.math.atan2
5 | import kotlin.math.sqrt
6 |
7 | /**
8 | * author :Peakmain
9 | * createTime:2020/3/15
10 | * mail:2726449200@qq.com
11 | * describe:
12 | */
13 | object MathUtils {
14 | /**
15 | * 两点之间的距离
16 | */
17 | @JvmStatic
18 | fun distance(x1: Double, y1: Double, x2: Double, y2: Double): Double {
19 | return sqrt(
20 | abs(x1 - x2) * abs(x1 - x2)
21 | + abs(y1 - y2) * abs(y1 - y2)
22 | )
23 | }
24 |
25 | /**
26 | * 转成度
27 | */
28 | fun pointTotoDegrees(x: Double, y: Double): Double {
29 | return Math.toDegrees(atan2(x, y))
30 | }
31 |
32 | /**
33 | * 是否在圆内
34 | */
35 | @JvmStatic
36 | fun checkInRound(
37 | sx: Float, sy: Float, r: Float, x: Float,
38 | y: Float
39 | ): Boolean {
40 | // x的平方 + y的平方 开根号 < 半径
41 | return sqrt((sx - x) * (sx - x) + (sy - y) * (sy - y).toDouble()) < r
42 | }
43 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/OkHttpManager.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils
2 |
3 | import com.peakmain.ui.utils.network.intercept.CacheResponseInterceptor
4 | import com.peakmain.ui.utils.network.intercept.LoggerInterceptor
5 | import okhttp3.OkHttpClient
6 | import java.util.concurrent.TimeUnit
7 |
8 | /**
9 | * author :Peakmain
10 | * createTime:2020/9/12
11 | * mail:2726449200@qq.com
12 | * describe:okhttp的管理类
13 | */
14 | class OkHttpManager private constructor() {
15 | /**
16 | * 下载文件的okHttp实例
17 | *
18 | * @return OkHttpClient
19 | */
20 | val okHttpClient: OkHttpClient by lazy {
21 | OkHttpClient().newBuilder()
22 | .addInterceptor(LoggerInterceptor())
23 | .connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS)
24 | .readTimeout(READ_TIMEOUT, TimeUnit.SECONDS)
25 | .addNetworkInterceptor(CacheResponseInterceptor())
26 | .writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS)
27 | .build()
28 | }
29 |
30 | companion object {
31 | //连接超时
32 | private const val CONNECT_TIMEOUT = 60L
33 |
34 | //阅读超时
35 | private const val READ_TIMEOUT = 10L
36 |
37 | //写入超时
38 | private const val WRITE_TIMEOUT = 10L
39 |
40 | //设缓存有效期为1天
41 | private const val CACHE_STALE_SEC = 60 * 60 * 24 * 1.toLong()
42 |
43 | //查询缓存的Cache-Control设置,为only-if-cached时只查询缓存而不会请求服务器,max-stale可以配合设置缓存失效时间
44 | const val CACHE_CONTROL_CACHE = "only-if-cached, max-stale=$CACHE_STALE_SEC"
45 |
46 | val instance by lazy(LazyThreadSafetyMode.SYNCHRONIZED){
47 | OkHttpManager()
48 | }
49 | }
50 |
51 |
52 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/launcher/dispatcher/DelayInitDispatcher.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.launcher.dispatcher
2 |
3 | import android.os.Looper
4 | import android.os.MessageQueue
5 | import com.peakmain.ui.utils.launcher.task.DispatchRunnable
6 | import com.peakmain.ui.utils.launcher.task.Task
7 | import java.util.*
8 |
9 | /**
10 | * author :Peakmain
11 | * createTime:2020/12/10
12 | * mail:2726449200@qq.com
13 | * describe:延时Task的一个处理器
14 | */
15 | class DelayInitDispatcher {
16 | private val mTasks: Queue = LinkedList()
17 | private val mIdleHandler = MessageQueue.IdleHandler {
18 | if (mTasks.size > 0) {
19 | val task = mTasks.poll()
20 | DispatchRunnable(task).run()
21 | }
22 | //false:不需要再监听
23 | !mTasks.isEmpty()
24 | }
25 |
26 | fun addTask(task: Task): DelayInitDispatcher {
27 | mTasks.add(task)
28 | return this
29 | }
30 |
31 | fun start() {
32 | Looper.myQueue().addIdleHandler(mIdleHandler)
33 | }
34 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/launcher/stat/TaskStat.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.launcher.stat
2 |
3 | import com.peakmain.ui.utils.LogUtils
4 | import java.util.*
5 | import java.util.concurrent.atomic.AtomicInteger
6 |
7 | /**
8 | * author :Peakmain
9 | * createTime:2020/12/10
10 | * mail:2726449200@qq.com
11 | * describe:
12 | */
13 | object TaskStat {
14 | @Volatile
15 | private var sCurrentSituation = ""
16 | private val sBeans: MutableList = ArrayList()
17 |
18 | //完成的任务数量
19 | private var sTaskDoneCount = AtomicInteger()
20 |
21 | // 是否开启统计
22 | private const val sOpenLaunchStat = false
23 | @JvmStatic
24 | var currentSituation: String
25 | get() = sCurrentSituation
26 | set(currentSituation) {
27 | if (!sOpenLaunchStat) {
28 | return
29 | }
30 | LogUtils.normal("currentSituation $currentSituation")
31 | sCurrentSituation = currentSituation
32 | setLaunchStat()
33 | }
34 |
35 | @JvmStatic
36 | fun markTaskDone() {
37 | sTaskDoneCount.getAndIncrement()
38 | }
39 |
40 | fun setLaunchStat() {
41 | val bean = TaskStatBean()
42 | bean.situation = sCurrentSituation
43 | bean.count = sTaskDoneCount.get()
44 | sBeans.add(bean)
45 | sTaskDoneCount = AtomicInteger(0)
46 | }
47 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/launcher/stat/TaskStatBean.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.launcher.stat
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2020/12/10
6 | * mail:2726449200@qq.com
7 | * describe:任务实体类
8 | */
9 | internal class TaskStatBean {
10 | var situation: String? = null
11 | var count = 0
12 |
13 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/launcher/task/ITask.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.launcher.task
2 |
3 | import android.os.Process
4 | import androidx.annotation.IntRange
5 | import java.util.concurrent.Executor
6 |
7 | /**
8 | * author :Peakmain
9 | * createTime:2020/12/10
10 | * mail:2726449200@qq.com
11 | * describe:任务Task接口
12 | */
13 | interface ITask {
14 | /**
15 | * 优先级
16 | */
17 | @IntRange(from = Process.THREAD_PRIORITY_FOREGROUND.toLong(), to = Process.THREAD_PRIORITY_LOWEST.toLong())
18 | fun priority(): Int
19 |
20 | /**
21 | * 运行
22 | */
23 | fun run()
24 |
25 | /**
26 | * Task执行所在的线程池
27 | */
28 | fun runOn(): Executor?
29 |
30 | /**
31 | * 依赖关系
32 | */
33 | fun dependsOn(): List?>?
34 |
35 | /**
36 | * 异步线程执行的Task是否需要在被调用await的时候等待,默认不需要
37 | */
38 | fun needWait(): Boolean
39 |
40 | /**
41 | * 是否运行在主线程
42 | */
43 | fun runOnMainThread(): Boolean
44 |
45 | /**
46 | * 是否只在主线程执行
47 | */
48 | fun onlyInMainProcess(): Boolean
49 |
50 | /**
51 | * Task主任务执行完成之后需要执行的任务
52 | */
53 | val tailRunnable: Runnable?
54 |
55 | /**
56 | * 设置回掉
57 | */
58 | fun setTaskCallBack(callBack: TaskCallBack?)
59 |
60 | /**
61 | * 是否回掉
62 | */
63 | fun needCall(): Boolean
64 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/launcher/task/MainTask.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.launcher.task
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2020/12/10
6 | * mail:2726449200@qq.com
7 | * describe:主任务
8 | */
9 | abstract class MainTask : Task() {
10 | override fun runOnMainThread(): Boolean {
11 | return true
12 | }
13 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/launcher/task/TaskCallBack.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.launcher.task
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2020/12/10
6 | * mail:2726449200@qq.com
7 | * describe:任务回掉
8 | */
9 | interface TaskCallBack {
10 | fun call()
11 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/log/ConsolePrinter.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.log;
2 |
3 |
4 | import static com.peakmain.ui.utils.log.LogConfig.MAX_LEN;
5 |
6 | import android.util.Log;
7 |
8 | import androidx.annotation.NonNull;
9 |
10 |
11 | /**
12 | * author :Peakmain
13 | * createTime:2021/3/14
14 | * mail:2726449200@qq.com
15 | * describe:控制台打印
16 | */
17 | public class ConsolePrinter implements LogPrinter {
18 | @Override
19 | public void print(@NonNull LogConfig config, int level, String tag, @NonNull String printString) {
20 | //打印的长度
21 | int length = printString.length();
22 | int countOfStub = length / MAX_LEN;
23 | if (countOfStub > 0) {
24 | StringBuilder sb = new StringBuilder();
25 | int index = 0;
26 | for (int i = 0; i < countOfStub; i++) {
27 | sb.append(printString, index, index + MAX_LEN);
28 | index = index + MAX_LEN;
29 | }
30 | if (index != length) {
31 | sb.append(printString, index, length);
32 | }
33 | Log.println(level, tag, sb.toString());
34 | } else {
35 | //一行
36 | Log.println(level, tag, printString);
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/log/LogConfig.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.log;
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2021/3/14
6 | * mail:2726449200@qq.com
7 | * describe:
8 | */
9 | public class LogConfig {
10 | public static int MAX_LEN = 512;
11 | static ThreadFormatter THREAD_FORMATTER = new ThreadFormatter();
12 | static StackTraceFormatter STACK_TRACE_FORMATTER = new StackTraceFormatter();
13 |
14 | public String getGlobalTag() {
15 | return "BasicUI";
16 | }
17 |
18 | //自定义注入
19 | public JsonParser injectJsonParser() {
20 | return null;
21 | }
22 |
23 | public boolean enable() {
24 | return true;
25 | }
26 |
27 | //是否打印线程
28 | public boolean printThread() {
29 | return false;
30 | }
31 |
32 | //打印堆栈的深度
33 | public int stackTraceDepth() {
34 | return 3;
35 | }
36 |
37 | public static class DefalutConfig extends LogConfig {
38 | @Override
39 | public boolean enable() {
40 | return true;
41 | }
42 | }
43 |
44 | public interface JsonParser {
45 | String toJson(Object src);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/log/LogFormatter.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.log;
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2021/3/14
6 | * mail:2726449200@qq.com
7 | * describe:日志进行格式化
8 | */
9 | public interface LogFormatter {
10 | String format(T message);
11 | }
12 |
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/log/LogPrinter.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.log;
2 |
3 |
4 | import androidx.annotation.NonNull;
5 |
6 | /**
7 | * author :Peakmain
8 | * createTime:2021/3/14
9 | * mail:2726449200@qq.com
10 | * describe:打印接口
11 | */
12 | public interface LogPrinter {
13 | void print(@NonNull LogConfig config, int level, String tag, @NonNull String printString);
14 | }
15 |
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/log/LogRecord.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.log;
2 |
3 | import java.text.SimpleDateFormat;
4 | import java.util.Locale;
5 |
6 | /**
7 | * author :Peakmain
8 | * createTime:2021/3/14
9 | * mail:2726449200@qq.com
10 | * describe:
11 | */
12 | public class LogRecord {
13 | private static SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd HH:mm:ss", Locale.CHINA);
14 | public long timeMillis;
15 | public int level;
16 | public String tag;
17 | public String message;
18 |
19 | public LogRecord(long timeMillis, int level, String tag, String message) {
20 | this.timeMillis = timeMillis;
21 | this.level = level;
22 | this.tag = tag;
23 | this.message = message;
24 | }
25 |
26 | public String flattenedLog() {
27 | return getFlattened() + "\n" + message;
28 | }
29 |
30 | public String getFlattened() {
31 | return format(timeMillis) + '|' + level + '|' + tag + "|:";
32 | }
33 |
34 | private String format(long timeMillis) {
35 | return sdf.format(timeMillis);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/log/StackTraceFormatter.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.log;
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2021/3/14
6 | * mail:2726449200@qq.com
7 | * describe:堆栈信息进行格式化
8 | */
9 | public class StackTraceFormatter implements LogFormatter {
10 | @Override
11 | public String format(StackTraceElement[] stackTrace) {
12 | StringBuilder sb = new StringBuilder(128);
13 | if (stackTrace == null || stackTrace.length == 0) {
14 | return null;
15 | } else if (stackTrace.length == 1) {
16 | return "\t─ " + stackTrace[0].toString();
17 | } else {
18 | for (int i = 0, len = stackTrace.length; i < len; i++) {
19 | if (i == 0) {
20 | sb.append("stackTrace: \n");
21 | }
22 | if (i != len - 1) {
23 | sb.append("\t├ ");
24 | sb.append(stackTrace[i].toString());
25 | sb.append("\n");
26 | } else {
27 | sb.append("\t└ ");
28 | sb.append(stackTrace[i].toString());
29 | }
30 | }
31 | return sb.toString();
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/log/StackTraceUtil.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.log;
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2021/3/14
6 | * mail:2726449200@qq.com
7 | * describe:无用的堆栈不打印
8 | */
9 | public class StackTraceUtil {
10 | public static StackTraceElement[] getCroppedRealStackTrack(StackTraceElement[] stackTrace, String ignorePackage, int maxDepth) {
11 | return cropStackTrace(getRealStackTrack(stackTrace, ignorePackage), maxDepth);
12 | }
13 |
14 | private static StackTraceElement[] getRealStackTrack(StackTraceElement[] stackTrace, String ignorePackage) {
15 | int ignoreDepth = 0;
16 | int allDepth = stackTrace.length;
17 | String className;
18 | for (int i = allDepth - 1; i >= 0; i--) {
19 | className = stackTrace[i].getClassName();
20 | if (ignorePackage != null && className.startsWith(ignorePackage)) {
21 | ignoreDepth = i + 1;
22 | break;
23 | }
24 | }
25 | int realDepth = allDepth - ignoreDepth;
26 | StackTraceElement[] realStack = new StackTraceElement[realDepth];
27 | System.arraycopy(stackTrace, ignoreDepth, realStack, 0, realDepth);
28 | return realStack;
29 | }
30 |
31 | private static StackTraceElement[] cropStackTrace(StackTraceElement[] callStack, int maxDepth) {
32 | int realDepth = callStack.length;
33 | if (maxDepth > 0) {
34 | realDepth = Math.min(maxDepth, realDepth);
35 | }
36 | StackTraceElement[] realStack = new StackTraceElement[realDepth];
37 | System.arraycopy(callStack, 0, realStack, 0, realDepth);
38 | return realStack;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/log/ThreadFormatter.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.log;
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2021/3/14
6 | * mail:2726449200@qq.com
7 | * describe:
8 | */
9 | public class ThreadFormatter implements LogFormatter {
10 | @Override
11 | public String format(Thread thread) {
12 | return "current Thread:"+thread.getName();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/network/callback/DownloadCallback.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.network.callback
2 |
3 | import java.io.File
4 |
5 | /**
6 | * author :Peakmain
7 | * createTime:2020/9/9
8 | * mail:2726449200@qq.com
9 | * describe:下载方法的回掉
10 | */
11 | interface DownloadCallback {
12 | fun onFailure(e: Exception?)
13 | fun onSucceed(file: File?)
14 | fun onProgress(progress: Int)
15 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/network/callback/EngineCallBack.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.network.callback
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2020/9/9
6 | * mail:2726449200@qq.com
7 | * describe:get,post方法默认回掉方法
8 | */
9 | interface EngineCallBack {
10 | //错误
11 | fun onError(e: Exception?)
12 |
13 | //成功 data{"",""} 成功 失败 data ""
14 | fun onSuccess(result: String?)
15 |
16 | companion object {
17 | //默认回调接口
18 | val DEFAULT_CALL_BACK: EngineCallBack = object : EngineCallBack {
19 | override fun onError(e: Exception?) {}
20 | override fun onSuccess(result: String?) {}
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/network/callback/ProgressEngineCallBack.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.network.callback
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2020/9/10
6 | * mail:2726449200@qq.com
7 | * describe:带进度的回掉
8 | */
9 | interface ProgressEngineCallBack : EngineCallBack {
10 | fun onProgress(total: Long, current: Long)
11 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/network/callback/UploadProgressListener.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.network.callback
2 |
3 | /**
4 | * author :Peakmain
5 | * createTime:2020/9/12
6 | * mail:2726449200@qq.com
7 | * describe:上传文件的回掉接口
8 | */
9 | interface UploadProgressListener {
10 | fun onProgress(total: Long, current: Long)
11 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/utils/network/intercept/CacheResponseInterceptor.kt:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.utils.network.intercept
2 |
3 | import okhttp3.Interceptor
4 | import okhttp3.Response
5 | import java.io.IOException
6 |
7 | /**
8 | * author :Peakmain
9 | * createTime:2020/9/12
10 | * mail:2726449200@qq.com
11 | * describe:设置缓存时间的拦截器 默认是30s
12 | */
13 | class CacheResponseInterceptor : Interceptor {
14 | private var mCacheTime = 30
15 |
16 | @Throws(IOException::class)
17 | override fun intercept(chain: Interceptor.Chain): Response {
18 | var response = chain.proceed(chain.request())
19 | response = response.newBuilder().removeHeader("Cache-Control")
20 | .addHeader("Cache-Control", "max-age=$mCacheTime")
21 | .build()
22 | return response
23 | }
24 |
25 | /**
26 | * 设置缓存时间
27 | *
28 | * @param mCacheTime 缓存的时间 单位s
29 | */
30 | fun setCacheTime(mCacheTime: Int) {
31 | this.mCacheTime = mCacheTime
32 | }
33 | }
--------------------------------------------------------------------------------
/ui/src/main/java/com/peakmain/ui/wheelview/adapter/ArrayWheelAdapter.java:
--------------------------------------------------------------------------------
1 | package com.peakmain.ui.wheelview.adapter;
2 |
3 | import java.util.List;
4 |
5 | /**
6 | * author:Peakmain
7 | * createTime:2021/5/17
8 | * mail:2726449200@qq.com
9 | * describe:
10 | */
11 | public class ArrayWheelAdapter implements WheelAdapter