├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── bug_report_cn.md
│ ├── feature-request.md
│ └── feature-request_cn.md
└── workflows
│ └── android.yml
├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── README-CN.md
├── README.md
├── art
├── auc_frame.png
├── auc_frame_cn.png
├── busutil_vs_eventbus.png
├── communication.png
├── donate.png
└── logo.png
├── build.gradle
├── buildApp.gradle
├── buildCommon.gradle
├── buildLib.gradle
├── buildSrc
├── .gitignore
├── build.gradle
├── settings.gradle
└── src
│ └── main
│ ├── groovy
│ ├── Config.groovy
│ ├── ConfigUtils.groovy
│ ├── GLog.groovy
│ ├── LibConfig.groovy
│ ├── ModuleConfig.groovy
│ ├── PluginConfig.groovy
│ └── TaskDurationUtils.groovy
│ └── java
│ └── com
│ └── blankj
│ └── plugin
│ └── readme
│ ├── FormatUtils.groovy
│ ├── ReadmeCorePlugin.groovy
│ ├── ReadmeExtension.groovy
│ └── ReadmeSubPlugin.groovy
├── config
├── flavor.gradle
└── publish.gradle
├── feature
├── launcher
│ └── app
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── blankj
│ │ └── launcher
│ │ └── app
│ │ └── LauncherApp.java
├── main
│ ├── app
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ └── com
│ │ │ └── blankj
│ │ │ └── main
│ │ │ └── app
│ │ │ └── MainApp.java
│ └── pkg
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── blankj
│ │ │ └── main
│ │ │ └── pkg
│ │ │ ├── MainActivity.kt
│ │ │ └── SplashActivity.kt
│ │ └── res
│ │ ├── layout
│ │ └── activity_main.xml
│ │ └── values
│ │ └── strings.xml
├── mock
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── blankj
│ │ └── mock
│ │ ├── subutil
│ │ └── SubUtilApiMock.java
│ │ └── utilcode
│ │ └── UtilCodeApiMock.java
├── subutil
│ ├── app
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ └── com
│ │ │ └── blankj
│ │ │ └── subutil
│ │ │ └── app
│ │ │ └── SubUtilApp.kt
│ ├── export
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ └── com
│ │ │ └── blankj
│ │ │ └── subutil
│ │ │ └── export
│ │ │ └── api
│ │ │ └── SubUtilApi.java
│ └── pkg
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── blankj
│ │ │ └── subutil
│ │ │ └── pkg
│ │ │ ├── Config.kt
│ │ │ ├── SubUtilApiImpl.java
│ │ │ └── feature
│ │ │ ├── SubUtilActivity.kt
│ │ │ ├── appStore
│ │ │ └── AppStoreActivity.kt
│ │ │ ├── battery
│ │ │ └── BatteryActivity.kt
│ │ │ ├── country
│ │ │ └── CountryActivity.kt
│ │ │ ├── dangerous
│ │ │ └── DangerousActivity.kt
│ │ │ ├── location
│ │ │ ├── LocationActivity.kt
│ │ │ └── LocationService.kt
│ │ │ └── pinyin
│ │ │ └── PinyinActivity.kt
│ │ └── res
│ │ └── values
│ │ └── strings.xml
└── utilcode
│ ├── app
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── blankj
│ │ └── utilcode
│ │ └── app
│ │ └── UtilCodeApp.kt
│ ├── export
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── blankj
│ │ └── utilcode
│ │ └── export
│ │ └── api
│ │ └── UtilCodeApi.java
│ └── pkg
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ ├── fonts
│ │ └── dnmbhs.ttf
│ └── test
│ │ ├── sub
│ │ └── test.txt
│ │ └── test.txt
│ ├── java
│ └── com
│ │ └── blankj
│ │ └── utilcode
│ │ └── pkg
│ │ ├── Config.kt
│ │ ├── UtilCodeApiImpl.java
│ │ ├── feature
│ │ ├── CoreUtilActivity.kt
│ │ ├── activity
│ │ │ ├── ActivityActivity.kt
│ │ │ └── SubActivityActivity.kt
│ │ ├── adaptScreen
│ │ │ ├── AdaptCloseActivity.kt
│ │ │ ├── AdaptHeightActivity.kt
│ │ │ ├── AdaptScreenActivity.kt
│ │ │ └── AdaptWidthActivity.kt
│ │ ├── api
│ │ │ ├── ApiActivity.kt
│ │ │ └── other
│ │ │ │ ├── export
│ │ │ │ └── OtherModuleApi.java
│ │ │ │ └── pkg
│ │ │ │ └── OtherPkgApiImpl.java
│ │ ├── app
│ │ │ └── AppActivity.kt
│ │ ├── bar
│ │ │ ├── BarActivity.kt
│ │ │ ├── nav
│ │ │ │ └── BarNavActivity.kt
│ │ │ ├── notification
│ │ │ │ └── BarNotificationActivity.kt
│ │ │ └── status
│ │ │ │ ├── BarStatusActivity.kt
│ │ │ │ ├── BarStatusActivityAlpha.kt
│ │ │ │ ├── BarStatusActivityColor.kt
│ │ │ │ ├── BarStatusActivityCustom.kt
│ │ │ │ ├── BarStatusActivityDrawer.kt
│ │ │ │ ├── BarStatusActivityImageView.kt
│ │ │ │ └── fragment
│ │ │ │ ├── BarStatusFragmentActivity.kt
│ │ │ │ ├── BarStatusFragmentAlpha.kt
│ │ │ │ ├── BarStatusFragmentColor.kt
│ │ │ │ ├── BarStatusFragmentCustom.kt
│ │ │ │ └── BarStatusFragmentImageView.kt
│ │ ├── brightness
│ │ │ └── BrightnessActivity.kt
│ │ ├── bus
│ │ │ ├── BusActivity.kt
│ │ │ └── BusCompareActivity.kt
│ │ ├── clean
│ │ │ └── CleanActivity.kt
│ │ ├── click
│ │ │ └── ClickActivity.kt
│ │ ├── clipboard
│ │ │ └── ClipboardActivity.kt
│ │ ├── device
│ │ │ └── DeviceActivity.kt
│ │ ├── file
│ │ │ └── FileActivity.kt
│ │ ├── flashlight
│ │ │ └── FlashlightActivity.kt
│ │ ├── fragment
│ │ │ ├── ChildFragment.kt
│ │ │ ├── ContainerFragment.kt
│ │ │ ├── FragmentActivity.kt
│ │ │ └── RootFragment.kt
│ │ ├── image
│ │ │ └── ImageActivity.kt
│ │ ├── intent
│ │ │ └── IntentActivity.kt
│ │ ├── keyboard
│ │ │ └── KeyboardActivity.kt
│ │ ├── language
│ │ │ └── LanguageActivity.kt
│ │ ├── log
│ │ │ └── LogActivity.kt
│ │ ├── messenger
│ │ │ ├── MessengerActivity.kt
│ │ │ └── MessengerRemoteActivity.kt
│ │ ├── metaData
│ │ │ └── MetaDataActivity.kt
│ │ ├── mvp
│ │ │ ├── MvpActivity.java
│ │ │ ├── MvpModel.java
│ │ │ ├── MvpMvp.java
│ │ │ ├── MvpPresenter.java
│ │ │ └── MvpView.java
│ │ ├── network
│ │ │ └── NetworkActivity.kt
│ │ ├── notification
│ │ │ └── NotificationActivity.kt
│ │ ├── path
│ │ │ └── PathActivity.kt
│ │ ├── permission
│ │ │ └── PermissionActivity.kt
│ │ ├── phone
│ │ │ └── PhoneActivity.kt
│ │ ├── process
│ │ │ └── ProcessActivity.kt
│ │ ├── reflect
│ │ │ ├── ReflectActivity.kt
│ │ │ └── TestPrivateStaticFinal.java
│ │ ├── resource
│ │ │ └── ResourceActivity.kt
│ │ ├── rom
│ │ │ └── RomActivity.kt
│ │ ├── screen
│ │ │ └── ScreenActivity.kt
│ │ ├── sdcard
│ │ │ └── SDCardActivity.kt
│ │ ├── shadow
│ │ │ └── ShadowActivity.kt
│ │ ├── snackbar
│ │ │ └── SnackbarActivity.kt
│ │ ├── spStatic
│ │ │ └── SPStaticActivity.kt
│ │ ├── span
│ │ │ └── SpanActivity.kt
│ │ ├── toast
│ │ │ ├── CustomToast.kt
│ │ │ └── ToastActivity.kt
│ │ ├── uiMessage
│ │ │ └── UiMessageActivity.kt
│ │ ├── vibrate
│ │ │ └── VibrateActivity.kt
│ │ └── volume
│ │ │ └── VolumeActivity.kt
│ │ └── helper
│ │ └── DialogHelper.kt
│ └── res
│ ├── anim
│ ├── fade_in_1000.xml
│ ├── fade_out_1000.xml
│ ├── slide_bottom_in_200.xml
│ ├── slide_bottom_out_200.xml
│ ├── slide_left_out_1000.xml
│ └── slide_right_in_1000.xml
│ ├── animator
│ ├── fragment_slide_left_enter.xml
│ ├── fragment_slide_left_exit.xml
│ ├── fragment_slide_right_enter.xml
│ └── fragment_slide_right_exit.xml
│ ├── drawable
│ ├── activity_activity_icon.png
│ ├── activity_activity_logo.png
│ ├── bar_status_custom.xml
│ ├── bar_status_nav_alpha.xml
│ ├── bar_status_nav_color.xml
│ ├── bar_status_nav_custom.xml
│ ├── bar_status_nav_image.xml
│ ├── fragment_nav.xml
│ ├── image_lena.jpg
│ ├── keyboard_dialog_bg.xml
│ ├── shadow_circle.xml
│ ├── shadow_round_rect.xml
│ ├── snackbar_custom_bg.xml
│ ├── span_block_high.xml
│ ├── span_block_low.xml
│ ├── span_cheetah.png
│ └── toast_round_rect.xml
│ ├── layout
│ ├── activity_adaptscreen.xml
│ ├── activity_item_shared_element_activity.xml
│ ├── activity_sub_activity.xml
│ ├── adaptscreen_close_activity.xml
│ ├── adaptscreen_height_activity.xml
│ ├── adaptscreen_width_activity.xml
│ ├── bar_status_alpha_activity.xml
│ ├── bar_status_alpha_fragment.xml
│ ├── bar_status_color_fragment.xml
│ ├── bar_status_custom_fragment.xml
│ ├── bar_status_drawer_activity.xml
│ ├── bar_status_fragment_activity.xml
│ ├── bar_status_image_view_activity.xml
│ ├── bar_status_image_view_fragment.xml
│ ├── fragment_activity.xml
│ ├── fragment_child.xml
│ ├── fragment_container.xml
│ ├── fragment_dialog.xml
│ ├── fragment_item_shared_element.xml
│ ├── fragment_root.xml
│ ├── keyboard_activity.xml
│ ├── keyboard_dialog.xml
│ ├── mvp_activity.xml
│ ├── screen_dialog.xml
│ ├── shadow_activity.xml
│ ├── snackbar_custom.xml
│ ├── span_activity.xml
│ ├── toast_custom.xml
│ └── toast_dialog.xml
│ ├── menu
│ ├── fragment_nav.xml
│ └── status_bar_nav.xml
│ ├── raw
│ └── test.txt
│ ├── transition
│ ├── explode_1000.xml
│ ├── fade_1000.xml
│ └── slide_1000.xml
│ ├── values-en-rUS
│ └── strings.xml
│ ├── values-zh-rCN
│ └── strings.xml
│ └── values
│ ├── ids.xml
│ ├── strings.xml
│ └── styles.xml
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── lib
├── base
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── blankj
│ │ │ └── base
│ │ │ ├── BaseActivity.java
│ │ │ ├── BaseApplication.java
│ │ │ ├── BaseFragment.java
│ │ │ ├── IBaseView.java
│ │ │ ├── dialog
│ │ │ ├── BaseDialog.java
│ │ │ ├── BaseDialogFragment.java
│ │ │ ├── DialogCallback.java
│ │ │ └── DialogLayoutCallback.java
│ │ │ ├── mvp
│ │ │ ├── BaseModel.java
│ │ │ ├── BasePresenter.java
│ │ │ └── BaseView.java
│ │ │ ├── rv
│ │ │ ├── BaseItem.java
│ │ │ ├── BaseItemAdapter.java
│ │ │ ├── ItemViewHolder.java
│ │ │ └── RecycleViewDivider.java
│ │ │ └── view
│ │ │ └── EmptyGoneTextView.java
│ │ └── res
│ │ └── layout
│ │ ├── activity_back.xml
│ │ └── fragment_lazy.xml
├── common
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── assets
│ │ └── test_install
│ │ ├── java
│ │ └── com
│ │ │ └── blankj
│ │ │ └── common
│ │ │ ├── CommonApplication.java
│ │ │ ├── activity
│ │ │ ├── CommonActivity.java
│ │ │ ├── CommonActivityDrawerView.java
│ │ │ ├── CommonActivityItemsView.java
│ │ │ └── CommonActivityTitleView.java
│ │ │ ├── dialog
│ │ │ ├── CommonDialogContent.java
│ │ │ └── CommonDialogLoading.java
│ │ │ ├── fragment
│ │ │ └── CommonFragment.java
│ │ │ ├── helper
│ │ │ └── PermissionHelper.kt
│ │ │ ├── item
│ │ │ ├── CommonItem.java
│ │ │ ├── CommonItemClick.java
│ │ │ ├── CommonItemImage.java
│ │ │ ├── CommonItemSeekBar.java
│ │ │ ├── CommonItemSwitch.java
│ │ │ └── CommonItemTitle.java
│ │ │ └── view
│ │ │ └── RotateView.java
│ │ └── res
│ │ ├── anim
│ │ ├── slide_in_left.xml
│ │ ├── slide_in_right.xml
│ │ ├── slide_out_left.xml
│ │ └── slide_out_right.xml
│ │ ├── drawable-xxhdpi
│ │ ├── common_avatar_round.png
│ │ ├── common_bg_header.jpeg
│ │ ├── common_ic_item_go.png
│ │ ├── common_loading.png
│ │ ├── common_switch_thumb.xml
│ │ └── common_switch_track.xml
│ │ ├── drawable
│ │ ├── common_back.png
│ │ ├── common_button_bg.xml
│ │ ├── common_button_txt_color.xml
│ │ ├── common_content_dialog_bg.xml
│ │ ├── common_content_dialog_btn_bg.xml
│ │ ├── common_item_divider.xml
│ │ ├── common_loading_bg.xml
│ │ ├── common_rotate_loading.xml
│ │ ├── common_scrollbar_thumb.xml
│ │ ├── common_seekbar_progress.xml
│ │ ├── common_seekbar_thumb.xml
│ │ ├── common_splash.xml
│ │ ├── main_menu_blog.xml
│ │ └── main_menu_github.xml
│ │ ├── layout
│ │ ├── common_activity_drawer.xml
│ │ ├── common_activity_drawer_nav_header.xml
│ │ ├── common_activity_title.xml
│ │ ├── common_activity_title_stub_no_scroll.xml
│ │ ├── common_activity_title_stub_scroll.xml
│ │ ├── common_dialog_content.xml
│ │ ├── common_dialog_loading.xml
│ │ ├── common_item.xml
│ │ ├── common_item_title_click.xml
│ │ ├── common_item_title_content.xml
│ │ ├── common_item_title_image.xml
│ │ ├── common_item_title_seekbar.xml
│ │ └── common_item_title_switch.xml
│ │ ├── menu
│ │ └── common_drawer.xml
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
├── subutil
│ ├── .gitignore
│ ├── README-CN.md
│ ├── README.md
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── blankj
│ │ │ └── subutil
│ │ │ └── util
│ │ │ ├── AppStoreUtils.java
│ │ │ ├── BatteryUtils.java
│ │ │ ├── BitUtils.java
│ │ │ ├── CameraUtils.java
│ │ │ ├── CoordinateUtils.java
│ │ │ ├── CountryUtils.java
│ │ │ ├── DangerousUtils.java
│ │ │ ├── GlideUtils.java
│ │ │ ├── HttpsUtil.java
│ │ │ ├── LocationUtils.java
│ │ │ ├── LunarUtils.java
│ │ │ ├── PinyinUtils.java
│ │ │ ├── RetrofitUtils.java
│ │ │ ├── TemperatureUtils.java
│ │ │ ├── Utils.java
│ │ │ └── http
│ │ │ ├── Chain.java
│ │ │ ├── ExecutorFactory.java
│ │ │ ├── Headers.java
│ │ │ ├── HttpUtils.java
│ │ │ ├── Interceptor.java
│ │ │ ├── Request.java
│ │ │ ├── Response.java
│ │ │ ├── ResponseCallback.java
│ │ │ └── SSLConfig.java
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── blankj
│ │ └── subutil
│ │ └── util
│ │ ├── BaseTest.java
│ │ ├── CoordinateUtilsTest.java
│ │ ├── LunarUtilsTest.java
│ │ ├── TemperatureUtilsTest.java
│ │ ├── TestConfig.java
│ │ └── http
│ │ ├── HttpUtilsTest.java
│ │ └── UserBean.java
├── utilcode
│ ├── .gitignore
│ ├── README-CN.md
│ ├── README.md
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── blankj
│ │ │ │ └── utilcode
│ │ │ │ ├── constant
│ │ │ │ ├── CacheConstants.java
│ │ │ │ ├── MemoryConstants.java
│ │ │ │ ├── PermissionConstants.java
│ │ │ │ ├── RegexConstants.java
│ │ │ │ └── TimeConstants.java
│ │ │ │ └── util
│ │ │ │ ├── ActivityUtils.java
│ │ │ │ ├── AdaptScreenUtils.java
│ │ │ │ ├── ApiUtils.java
│ │ │ │ ├── AppUtils.java
│ │ │ │ ├── ArrayUtils.java
│ │ │ │ ├── BarUtils.java
│ │ │ │ ├── BrightnessUtils.java
│ │ │ │ ├── BusUtils.java
│ │ │ │ ├── CacheDiskStaticUtils.java
│ │ │ │ ├── CacheDiskUtils.java
│ │ │ │ ├── CacheDoubleStaticUtils.java
│ │ │ │ ├── CacheDoubleUtils.java
│ │ │ │ ├── CacheMemoryStaticUtils.java
│ │ │ │ ├── CacheMemoryUtils.java
│ │ │ │ ├── CleanUtils.java
│ │ │ │ ├── ClickUtils.java
│ │ │ │ ├── ClipboardUtils.java
│ │ │ │ ├── CloneUtils.java
│ │ │ │ ├── CloseUtils.java
│ │ │ │ ├── CollectionUtils.java
│ │ │ │ ├── ColorUtils.java
│ │ │ │ ├── ConvertUtils.java
│ │ │ │ ├── CrashUtils.java
│ │ │ │ ├── DebouncingUtils.java
│ │ │ │ ├── DeviceUtils.java
│ │ │ │ ├── DialogUtils.java
│ │ │ │ ├── EncodeUtils.java
│ │ │ │ ├── EncryptUtils.java
│ │ │ │ ├── FileIOUtils.java
│ │ │ │ ├── FileUtils.java
│ │ │ │ ├── FlashlightUtils.java
│ │ │ │ ├── FragmentUtils.java
│ │ │ │ ├── GsonUtils.java
│ │ │ │ ├── ImageUtils.java
│ │ │ │ ├── IntentUtils.java
│ │ │ │ ├── JsonUtils.java
│ │ │ │ ├── KeyboardUtils.java
│ │ │ │ ├── LanguageUtils.java
│ │ │ │ ├── LogUtils.java
│ │ │ │ ├── MapUtils.java
│ │ │ │ ├── MessengerUtils.java
│ │ │ │ ├── MetaDataUtils.java
│ │ │ │ ├── NetworkUtils.java
│ │ │ │ ├── NotificationUtils.java
│ │ │ │ ├── NumberUtils.java
│ │ │ │ ├── ObjectUtils.java
│ │ │ │ ├── PathUtils.java
│ │ │ │ ├── PermissionUtils.java
│ │ │ │ ├── PhoneUtils.java
│ │ │ │ ├── ProcessUtils.java
│ │ │ │ ├── ReflectUtils.java
│ │ │ │ ├── RegexUtils.java
│ │ │ │ ├── ResourceUtils.java
│ │ │ │ ├── RomUtils.java
│ │ │ │ ├── SDCardUtils.java
│ │ │ │ ├── SPStaticUtils.java
│ │ │ │ ├── SPUtils.java
│ │ │ │ ├── ScreenUtils.java
│ │ │ │ ├── ServiceUtils.java
│ │ │ │ ├── ShadowUtils.java
│ │ │ │ ├── ShellUtils.java
│ │ │ │ ├── SizeUtils.java
│ │ │ │ ├── SnackbarUtils.java
│ │ │ │ ├── SpanUtils.java
│ │ │ │ ├── StringUtils.java
│ │ │ │ ├── ThreadUtils.java
│ │ │ │ ├── ThrowableUtils.java
│ │ │ │ ├── TimeUtils.java
│ │ │ │ ├── ToastUtils.java
│ │ │ │ ├── TouchUtils.java
│ │ │ │ ├── UiMessageUtils.java
│ │ │ │ ├── UriUtils.java
│ │ │ │ ├── Utils.java
│ │ │ │ ├── UtilsActivityLifecycleImpl.java
│ │ │ │ ├── UtilsBridge.java
│ │ │ │ ├── UtilsFileProvider.java
│ │ │ │ ├── UtilsTransActivity.java
│ │ │ │ ├── UtilsTransActivity4MainProcess.java
│ │ │ │ ├── VibrateUtils.java
│ │ │ │ ├── ViewUtils.java
│ │ │ │ ├── VolumeUtils.java
│ │ │ │ └── ZipUtils.java
│ │ └── res
│ │ │ ├── drawable
│ │ │ └── utils_toast_bg.xml
│ │ │ ├── layout
│ │ │ └── utils_toast_view.xml
│ │ │ ├── values-v21
│ │ │ └── styles.xml
│ │ │ ├── values
│ │ │ └── styles.xml
│ │ │ └── xml
│ │ │ └── util_code_provider_paths.xml
│ │ └── test
│ │ ├── java
│ │ └── com
│ │ │ └── blankj
│ │ │ └── utilcode
│ │ │ └── util
│ │ │ ├── ApiUtilsTest.java
│ │ │ ├── ArrayUtilsTest.java
│ │ │ ├── BaseTest.java
│ │ │ ├── BusUtilsTest.java
│ │ │ ├── BusUtilsVsEventBusTest.java
│ │ │ ├── CacheDiskStaticUtilsTest.java
│ │ │ ├── CacheDiskUtilsTest.java
│ │ │ ├── CacheDoubleStaticUtilsTest.java
│ │ │ ├── CacheDoubleUtilsTest.java
│ │ │ ├── CacheMemoryStaticUtilsTest.java
│ │ │ ├── CacheMemoryUtilsTest.java
│ │ │ ├── CloneUtilsTest.java
│ │ │ ├── CollectionUtilsTest.java
│ │ │ ├── ColorUtilsTest.java
│ │ │ ├── ConvertUtilsTest.java
│ │ │ ├── EncodeUtilsTest.java
│ │ │ ├── EncryptUtilsTest.java
│ │ │ ├── FileIOUtilsTest.java
│ │ │ ├── FileUtilsTest.java
│ │ │ ├── GsonUtilsTest.java
│ │ │ ├── ImageUtilsTest.java
│ │ │ ├── LogUtilsTest.java
│ │ │ ├── MapUtilsTest.java
│ │ │ ├── NumberUtilsTest.java
│ │ │ ├── ObjectUtilsTest.java
│ │ │ ├── PathUtilsTest.java
│ │ │ ├── RegexUtilsTest.java
│ │ │ ├── StringUtilsTest.java
│ │ │ ├── TestConfig.java
│ │ │ ├── ThreadUtilsTest.java
│ │ │ ├── TimeUtilsTest.java
│ │ │ ├── UiMessageUtilsTest.java
│ │ │ ├── ZipUtilsTest.java
│ │ │ └── reflect
│ │ │ ├── PrivateConstructors.java
│ │ │ ├── ReflectUtilsTest.java
│ │ │ ├── Test1.java
│ │ │ ├── Test10.java
│ │ │ ├── Test2.java
│ │ │ ├── Test3.java
│ │ │ ├── Test4.java
│ │ │ ├── Test5.java
│ │ │ ├── Test6.java
│ │ │ ├── Test7.java
│ │ │ ├── Test8.java
│ │ │ ├── Test9.java
│ │ │ ├── TestHierarchicalMethodsBase.java
│ │ │ ├── TestHierarchicalMethodsSubclass.java
│ │ │ └── TestPrivateStaticFinal.java
│ │ └── res
│ │ ├── encrypt
│ │ └── MD5.txt
│ │ ├── file
│ │ ├── GBK.txt
│ │ ├── UTF16BE.txt
│ │ ├── UTF8.txt
│ │ ├── Unicode.txt
│ │ └── recuresive
│ │ │ └── UTF8.txt
│ │ ├── image
│ │ ├── ic_launcher.bmp
│ │ ├── ic_launcher.gif
│ │ ├── ic_launcher.ico
│ │ ├── ic_launcher.jpg
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher.tif
│ │ └── ic_launcher.webp
│ │ └── zip
│ │ ├── test.txt
│ │ ├── testDir
│ │ └── test.txt
│ │ ├── 测试.txt
│ │ └── 测试文件夹
│ │ └── 测试.txt
├── utildebug-no-op
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── blankj
│ │ └── utildebug
│ │ ├── DebugUtils.java
│ │ └── debug
│ │ └── IDebug.java
└── utildebug
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── blankj
│ │ └── utildebug
│ │ ├── DebugUtils.java
│ │ ├── base
│ │ ├── drawable
│ │ │ └── PolygonDrawable.java
│ │ ├── rv
│ │ │ ├── BaseItem.java
│ │ │ ├── BaseItemAdapter.java
│ │ │ ├── ItemViewHolder.java
│ │ │ └── RecycleViewDivider.java
│ │ └── view
│ │ │ ├── BaseContentFloatView.java
│ │ │ ├── BaseContentView.java
│ │ │ ├── BaseFloatView.java
│ │ │ ├── EmptyGoneTextView.java
│ │ │ ├── FloatEditText.java
│ │ │ ├── FloatToast.java
│ │ │ ├── FloatViewManager.java
│ │ │ ├── SearchEditText.java
│ │ │ ├── SwipeRightMenu.java
│ │ │ └── listener
│ │ │ ├── OnBackListener.java
│ │ │ └── OnRefreshListener.java
│ │ ├── config
│ │ └── DebugConfig.java
│ │ ├── debug
│ │ ├── IDebug.java
│ │ └── tool
│ │ │ ├── AbsToolDebug.java
│ │ │ ├── appInfo
│ │ │ ├── AppInfoDebug.java
│ │ │ ├── AppInfoFloatView.java
│ │ │ └── AppInfoItem.java
│ │ │ ├── clearCache
│ │ │ └── ClearCacheDebug.java
│ │ │ ├── clearStorage
│ │ │ └── ClearStorageDebug.java
│ │ │ ├── deviceInfo
│ │ │ ├── DeviceInfoDebug.java
│ │ │ ├── DeviceInfoFloatView.java
│ │ │ └── DeviceInfoItem.java
│ │ │ ├── fileExplorer
│ │ │ ├── FileContentView.java
│ │ │ ├── FileExplorerDebug.java
│ │ │ ├── FileExplorerFloatView.java
│ │ │ ├── FileItem.java
│ │ │ ├── image
│ │ │ │ └── ImageViewer.java
│ │ │ ├── sp
│ │ │ │ ├── SpItem.java
│ │ │ │ ├── SpModifyContentView.java
│ │ │ │ └── SpViewerContentView.java
│ │ │ └── text
│ │ │ │ └── TextViewer.java
│ │ │ ├── logcat
│ │ │ └── LogcatDebug.java
│ │ │ └── restartApp
│ │ │ └── RestartAppDebug.java
│ │ ├── helper
│ │ ├── FileHelper.java
│ │ ├── ImageLoader.java
│ │ ├── ShadowHelper.java
│ │ ├── SpHelper.java
│ │ └── WindowHelper.java
│ │ ├── icon
│ │ └── DebugIcon.java
│ │ └── menu
│ │ ├── DebugItem.java
│ │ ├── DebugMenu.java
│ │ ├── DebugMenuItem.java
│ │ └── ReminderView.java
│ └── res
│ ├── anim
│ ├── float_in.xml
│ └── float_out.xml
│ ├── drawable-xxhdpi
│ ├── du_ic_debug_app_info_default.png
│ ├── du_ic_debug_clear_cache.png
│ ├── du_ic_debug_clear_storage.png
│ ├── du_ic_debug_device_info.png
│ ├── du_ic_debug_file_explorer.png
│ ├── du_ic_debug_logcat.png
│ ├── du_ic_debug_restart_app.png
│ ├── du_ic_icon_default.png
│ ├── du_ic_item_file_default.png
│ ├── du_ic_item_file_sp.png
│ ├── du_ic_item_file_utf8.png
│ ├── du_ic_item_go.png
│ ├── du_ic_reminder.png
│ ├── du_ic_swipe_back.png
│ ├── du_ic_swipe_refresh.png
│ ├── du_ic_title_bar_adjustable.png
│ ├── du_ic_title_bar_close.png
│ ├── du_ic_toast_error.png
│ ├── du_ic_toast_success.png
│ └── du_ic_toast_warn.png
│ ├── drawable
│ ├── du_rotate_refresh.xml
│ ├── du_sel_et_bg.xml
│ ├── du_shape_base_float_bg.xml
│ ├── du_shape_base_float_title_adjust_bg.xml
│ ├── du_shape_base_float_title_bg.xml
│ ├── du_shape_base_float_title_close_bg.xml
│ ├── du_shape_btn.xml
│ ├── du_shape_divider.xml
│ ├── du_shape_file_divider.xml
│ ├── du_shape_input_bg.xml
│ ├── du_shape_item_menu_bg.xml
│ ├── du_shape_positive_btn.xml
│ ├── du_shape_shadow.xml
│ ├── du_shape_toast.xml
│ ├── du_switch_thumb.xml
│ └── du_switch_track.xml
│ ├── layout
│ ├── du_base_content_float.xml
│ ├── du_debug_app_info.xml
│ ├── du_debug_device_info.xml
│ ├── du_debug_file_explorer.xml
│ ├── du_debug_file_explorer_image.xml
│ ├── du_debug_file_explorer_sp.xml
│ ├── du_debug_file_explorer_sp_modify.xml
│ ├── du_debug_icon.xml
│ ├── du_debug_menu.xml
│ ├── du_float_toast.xml
│ ├── du_item_base_info.xml
│ ├── du_item_empty.xml
│ ├── du_item_file.xml
│ ├── du_item_menu.xml
│ ├── du_item_menu_item.xml
│ ├── du_item_sp.xml
│ └── du_reminder_view.xml
│ ├── values-zh-rCN
│ └── strings.xml
│ └── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── ids.xml
│ ├── strings.xml
│ └── styles.xml
├── module_config.gradle
├── module_config.json
├── plugin
├── api-gradle-plugin
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── build.gradle
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ └── com
│ │ │ └── blankj
│ │ │ └── api
│ │ │ ├── ApiClassVisitor.java
│ │ │ ├── ApiExtension.groovy
│ │ │ ├── ApiInfo.java
│ │ │ ├── ApiInject.groovy
│ │ │ ├── ApiPlugin.groovy
│ │ │ ├── ApiUtilsClassVisitor.java
│ │ │ └── Config.groovy
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── blankj
│ │ └── api
│ │ ├── ApiTest.java
│ │ └── ApiUtils.java
├── buildSrc-plugin
│ ├── .gitignore
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── blankj
│ │ └── buildSrc
│ │ ├── BuildSrcPlugin.groovy
│ │ └── ModuleCfg.groovy
├── bus-gradle-plugin
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── build.gradle
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ └── com
│ │ │ └── blankj
│ │ │ └── bus
│ │ │ ├── BusClassVisitor.java
│ │ │ ├── BusExtension.groovy
│ │ │ ├── BusInfo.java
│ │ │ ├── BusInject.groovy
│ │ │ ├── BusPlugin.groovy
│ │ │ ├── BusUtilsClassVisitor.java
│ │ │ └── Config.groovy
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── blankj
│ │ └── bus
│ │ ├── BusTest.java
│ │ └── BusUtils.java
└── lib
│ └── base-transform
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── build.gradle
│ └── src
│ └── main
│ └── java
│ └── com
│ └── blankj
│ └── base_transform
│ ├── BaseTransformCallback.groovy
│ ├── BaseTransformConfig.groovy
│ ├── BaseTransformPlugin.groovy
│ └── util
│ ├── JsonUtils.groovy
│ ├── LogUtils.groovy
│ └── ZipUtils.java
├── script
├── gitHelp.sh
├── runDevDebug.sh
└── runProductionRelease.sh
├── settings.gradle
└── sign
├── keystore.jks
└── keystore.properties
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/donate.png
13 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report_cn.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 提交 Bug
3 | about: 让工具类更完美!
4 | labels: bug
5 | assignees: Blankj
6 |
7 | ---
8 |
9 | ## 描述 Bug
10 |
11 | 简洁地描述下 Bug。
12 |
13 | - AndroidUtilCode 的版本:
14 | - 出现 Bug 的设备型号:
15 | - 设备的 Android 版本:
16 |
17 | ## 相关代码
18 |
19 |
24 | ```
25 | put your code here
26 | ```
27 |
28 | ## 异常堆栈
29 |
30 |
40 |
41 | ```
42 | put the stack of crash here
43 | ```
44 |
45 | ## 截图
46 |
47 | 如果有的话请添加屏幕截图以帮助解释问题。
48 |
49 |
50 | ## 请删除当前行及以下内容
51 |
52 | 感谢支持 [AndroidUtilCode](https://github.com/Blankj/AndroidUtilCode).
53 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature-request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Make AndroidUtilCode more perfect!
4 | labels: help wanted
5 | assignees: Blankj
6 |
7 | ---
8 |
9 | ## Describe the feature
10 |
11 | A clear and concise description of what the feature is.
12 |
13 |
14 | ## Reference
15 |
16 | Hope to give some reference articles, links, code, if any.
17 |
18 |
19 | ## Please delete the current line and the following
20 |
21 | Thank you for supporting [AndroidUtilCode](https://github.com/Blankj/AndroidUtilCode).
22 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature-request_cn.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 提交需求
3 | about: 让工具类更健全!
4 | labels: help wanted
5 | assignees: Blankj
6 |
7 | ---
8 |
9 | ## 描述需求
10 |
11 | 简洁地描述下需求。
12 |
13 |
14 | ## 可借鉴的
15 |
16 | 如果有的话,可以给出一些参考文章、链接、代码
17 |
18 |
19 | ## 请删除当前行及以下内容
20 |
21 | 感谢支持 [AndroidUtilCode](https://github.com/Blankj/AndroidUtilCode).
22 |
--------------------------------------------------------------------------------
/.github/workflows/android.yml:
--------------------------------------------------------------------------------
1 | name: Android CI
2 |
3 | on: [push]
4 |
5 | jobs:
6 | build:
7 |
8 | runs-on: ubuntu-latest
9 |
10 | steps:
11 | - uses: actions/checkout@v2
12 | - name: set up JDK 1.8
13 | uses: actions/setup-java@v1
14 | with:
15 | java-version: 1.8
16 | - name: Build with Gradle
17 | run: ./gradlew build aR
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | __api__.json
3 | __bus__.json
4 | .gradle
5 | local.properties
6 | .idea
7 | .DS_Store
8 | /build
9 | /captures
10 | .externalNativeBuild
11 | /apk
12 | *.phrof
13 | /mavenLocal
14 | /reports
15 | */reports
--------------------------------------------------------------------------------
/art/auc_frame.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/art/auc_frame.png
--------------------------------------------------------------------------------
/art/auc_frame_cn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/art/auc_frame_cn.png
--------------------------------------------------------------------------------
/art/busutil_vs_eventbus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/art/busutil_vs_eventbus.png
--------------------------------------------------------------------------------
/art/communication.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/art/communication.png
--------------------------------------------------------------------------------
/art/donate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/art/donate.png
--------------------------------------------------------------------------------
/art/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/art/logo.png
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | ConfigUtils.init(gradle)
4 | repositories {
5 | mavenLocal()
6 | google()
7 | mavenCentral()
8 | jcenter()
9 | }
10 |
11 | dependencies {
12 | for (def entrySet : ConfigUtils.getApplyPlugins().entrySet()) {
13 | classpath entrySet.value.path
14 | }
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | mavenLocal()
21 | maven { url "https://jitpack.io" }
22 | google()
23 | mavenCentral()
24 | jcenter()
25 | }
26 |
27 | configurations.all {
28 | resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
29 |
30 | resolutionStrategy.eachDependency {
31 | if (it.requested.group == 'com.android.support' && !it.requested.name.contains(
32 | 'multidex')) {
33 | it.useVersion Config.supportVersion
34 | }
35 | }
36 | }
37 | }
38 |
39 | task clean(type: Delete) {
40 | delete rootProject.buildDir
41 | }
--------------------------------------------------------------------------------
/buildCommon.gradle:
--------------------------------------------------------------------------------
1 | apply {
2 | plugin "kotlin-android"
3 | plugin "kotlin-android-extensions"
4 | }
5 |
6 | android {
7 | compileSdkVersion Config.compileSdkVersion
8 | defaultConfig {
9 | minSdkVersion Config.minSdkVersion
10 | versionCode Config.versionCode
11 | versionName Config.versionName
12 | consumerProguardFiles 'proguard-rules.pro'
13 | }
14 |
15 | buildTypes {
16 | release {
17 | minifyEnabled true
18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19 | }
20 | }
21 |
22 | compileOptions {
23 | sourceCompatibility JavaVersion.VERSION_1_8
24 | targetCompatibility JavaVersion.VERSION_1_8
25 | }
26 |
27 | lintOptions {
28 | abortOnError false
29 | }
30 | }
--------------------------------------------------------------------------------
/buildLib.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.library"
2 | apply from: "${rootDir.path}/buildCommon.gradle"
3 |
4 | dependencies {
5 | if (project.name.endsWith("_pkg") || project.name.endsWith("_mock")) {
6 | // if module's name equals 'pkg', api all of export
7 | for (def entrySet : ConfigUtils.getApplyExports().entrySet()) {
8 | api entrySet.value.dep
9 | }
10 | } else if (project.name.endsWith("_export")) {
11 | api Config.modules.lib_common.dep
12 | }
13 | }
--------------------------------------------------------------------------------
/buildSrc/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/buildSrc/build.gradle:
--------------------------------------------------------------------------------
1 | repositories {
2 | google()
3 | jcenter()
4 | }
5 |
6 | apply {
7 | plugin 'groovy'
8 | plugin 'java-gradle-plugin'
9 | }
10 |
11 | gradlePlugin {
12 | plugins {
13 | readmeCore {
14 | id = 'readme-core'
15 | implementationClass = 'com.blankj.plugin.readme.ReadmeCorePlugin'
16 | }
17 |
18 | readmeSub {
19 | id = 'readme-sub'
20 | implementationClass = 'com.blankj.plugin.readme.ReadmeSubPlugin'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation gradleApi()
27 | implementation localGroovy()
28 | implementation "commons-io:commons-io:2.6"
29 | }
30 |
31 | sourceSets {
32 | main {
33 | groovy {
34 | srcDirs += 'src/main/java'
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/buildSrc/settings.gradle:
--------------------------------------------------------------------------------
1 | //dependencyResolutionManagement {
2 | // repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
3 | // repositories {
4 | // google()
5 | // mavenCentral()
6 | // jcenter() // Warning: this repository is going to shut down soon
7 | // }
8 | //}
--------------------------------------------------------------------------------
/buildSrc/src/main/groovy/LibConfig.groovy:
--------------------------------------------------------------------------------
1 | class LibConfig {
2 |
3 | String path
4 |
5 | String getGroupId() {
6 | String[] splits = path.split(":")
7 | return splits.length == 3 ? splits[0] : null
8 | }
9 |
10 | String getArtifactId() {
11 | String[] splits = path.split(":")
12 | return splits.length == 3 ? splits[1] : null
13 | }
14 |
15 | String getVersion() {
16 | String[] splits = path.split(":")
17 | return splits.length == 3 ? splits[2] : null
18 | }
19 |
20 | @Override
21 | String toString() {
22 | return "LibConfig { path = $path }"
23 | }
24 |
25 | static String getFlag(boolean b) {
26 | return b ? "✅" : "❌"
27 | }
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/buildSrc/src/main/groovy/ModuleConfig.groovy:
--------------------------------------------------------------------------------
1 | class ModuleConfig {
2 |
3 | boolean isApply // 是否应用
4 | boolean useLocal // 是否使用本地的
5 | String localPath // 本地路径
6 | String remotePath // 远程路径
7 | def dep // 根据条件生成项目最终的依赖项
8 |
9 | String getGroupId() {
10 | String[] splits = remotePath.split(":")
11 | return splits.length == 3 ? splits[0] : null
12 | }
13 |
14 | String getArtifactId() {
15 | String[] splits = remotePath.split(":")
16 | return splits.length == 3 ? splits[1] : null
17 | }
18 |
19 | String getVersion() {
20 | String[] splits = remotePath.split(":")
21 | return splits.length == 3 ? splits[2] : null
22 | }
23 |
24 | @Override
25 | String toString() {
26 | return "ModuleConfig { isApply = ${getFlag(isApply)}" +
27 | ", dep = " + dep +
28 | " }"
29 | }
30 |
31 | static String getFlag(boolean b) {
32 | return b ? "✅" : "❌"
33 | }
34 | }
35 |
36 |
--------------------------------------------------------------------------------
/buildSrc/src/main/groovy/PluginConfig.groovy:
--------------------------------------------------------------------------------
1 | final class PluginConfig {
2 |
3 | boolean isApply = true // 是否应用
4 | boolean useLocal // 是否使用本地的
5 | String path // 插件路径
6 | String id // 插件 ID
7 |
8 | String getGroupId() {
9 | String[] splits = path.split(":")
10 | return splits.length == 3 ? splits[0] : null
11 | }
12 |
13 | String getArtifactId() {
14 | String[] splits = path.split(":")
15 | return splits.length == 3 ? splits[1] : null
16 | }
17 |
18 | String getVersion() {
19 | String[] splits = path.split(":")
20 | return splits.length == 3 ? splits[2] : null
21 | }
22 |
23 | @Override
24 | String toString() {
25 | return "PluginConfig { isApply = ${getFlag(isApply)}" +
26 | ", useLocal = ${getFlag(useLocal)}" +
27 | ", path = " + path +
28 | ", id = " + id +
29 | " }"
30 | }
31 |
32 | static String getFlag(boolean b) {
33 | return b ? "✅" : "❌"
34 | }
35 | }
--------------------------------------------------------------------------------
/buildSrc/src/main/java/com/blankj/plugin/readme/ReadmeExtension.groovy:
--------------------------------------------------------------------------------
1 | package com.blankj.plugin.readme
2 |
3 | class ReadmeExtension {
4 |
5 | File readmeFile
6 | File readmeCnFile
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/config/flavor.gradle:
--------------------------------------------------------------------------------
1 | android {
2 | flavorDimensions "env"
3 | productFlavors {
4 | dev {
5 | dimension "env"
6 | }
7 |
8 | production {
9 | dimension "env"
10 | }
11 | }
12 |
13 | variantFilter { variant ->
14 | def flavorNames = variant.flavors*.name
15 | def buildTypeName = variant.buildType.name
16 |
17 | // production 包不允许 debug 构建
18 | if (flavorNames.contains("production") && buildTypeName.contains("debug")) {
19 | variant.setIgnore(true)
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/feature/launcher/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/feature/launcher/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'kotlin-kapt'
2 |
3 | dependencies {
4 | kapt Config.libs.eventbus_processor.path
5 | }
--------------------------------------------------------------------------------
/feature/launcher/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/feature/launcher/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 | * author: Blankj 8 | * blog : http://blankj.com 9 | * time : 2016/10/12 10 | * desc : 11 | *12 | */ 13 | public class LauncherApp extends CommonApplication { 14 | 15 | private static LauncherApp sInstance; 16 | 17 | public static LauncherApp getInstance() { 18 | return sInstance; 19 | } 20 | 21 | @Override 22 | public void onCreate() { 23 | super.onCreate(); 24 | sInstance = this; 25 | } 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /feature/main/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /feature/main/app/build.gradle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/feature/main/app/build.gradle -------------------------------------------------------------------------------- /feature/main/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /feature/main/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 |
9 | * author: Blankj 10 | * blog : http://blankj.com 11 | * time : 2016/10/12 12 | * desc : 13 | *14 | */ 15 | public class MainApp extends CommonApplication { 16 | 17 | private static MainApp sInstance; 18 | 19 | public static MainApp getInstance() { 20 | return sInstance; 21 | } 22 | 23 | @Override 24 | protected void attachBaseContext(Context base) { 25 | super.attachBaseContext(base); 26 | } 27 | 28 | @Override 29 | public void onCreate() { 30 | super.onCreate(); 31 | sInstance = this; 32 | } 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /feature/main/pkg/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /feature/main/pkg/build.gradle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/feature/main/pkg/build.gradle -------------------------------------------------------------------------------- /feature/main/pkg/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 | -------------------------------------------------------------------------------- /feature/main/pkg/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |
11 | * author: Blankj 12 | * blog : http://blankj.com 13 | * time : 2019/07/10 14 | * desc : 15 | *16 | */ 17 | @ApiUtils.Api(isMock = true) 18 | public class SubUtilApiMock extends SubUtilApi { 19 | 20 | @Override 21 | public void startSubUtilActivity(Context context) { 22 | ToastUtils.showShort("startSubUtilActivity"); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /feature/mock/src/main/java/com/blankj/mock/utilcode/UtilCodeApiMock.java: -------------------------------------------------------------------------------- 1 | package com.blankj.mock.utilcode; 2 | 3 | import android.content.Context; 4 | 5 | import com.blankj.utilcode.export.api.UtilCodeApi; 6 | import com.blankj.utilcode.util.ApiUtils; 7 | import com.blankj.utilcode.util.ToastUtils; 8 | 9 | /** 10 | *
11 | * author: Blankj 12 | * blog : http://blankj.com 13 | * time : 2019/07/10 14 | * desc : 15 | *16 | */ 17 | @ApiUtils.Api(isMock = true) 18 | public class UtilCodeApiMock extends UtilCodeApi { 19 | 20 | @Override 21 | public void startUtilCodeActivity(Context context) { 22 | ToastUtils.showShort("startUtilCodeActivity"); 23 | } 24 | 25 | @Override 26 | public void testCallback(Callback callback) { 27 | if (callback != null) { 28 | callback.call(); 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /feature/subutil/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /feature/subutil/app/build.gradle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/feature/subutil/app/build.gradle -------------------------------------------------------------------------------- /feature/subutil/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /feature/subutil/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 |
10 | * author: Blankj 11 | * blog : http://blankj.com 12 | * time : 2019/06/09 13 | * desc : 14 | *15 | */ 16 | public abstract class SubUtilApi extends ApiUtils.BaseApi { 17 | 18 | public abstract void startSubUtilActivity(Context context); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /feature/subutil/pkg/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /feature/subutil/pkg/build.gradle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/feature/subutil/pkg/build.gradle -------------------------------------------------------------------------------- /feature/subutil/pkg/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 | -------------------------------------------------------------------------------- /feature/subutil/pkg/src/main/java/com/blankj/subutil/pkg/Config.kt: -------------------------------------------------------------------------------- 1 | package com.blankj.subutil.pkg 2 | 3 | import android.os.Environment 4 | import com.blankj.utilcode.util.Utils 5 | 6 | /** 7 | * ``` 8 | * author: Blankj 9 | * blog : http://blankj.com 10 | * time : 2017/05/10 11 | * desc : config about constants 12 | * ``` 13 | */ 14 | object Config { 15 | 16 | val FILE_SEP = System.getProperty("file.separator") 17 | val LINE_SEP = System.getProperty("line.separator") 18 | const val TEST_PKG = "com.blankj.testinstall" 19 | private val CACHE_PATH: String 20 | val TEST_APK_PATH: String 21 | 22 | init { 23 | val cacheDir = Utils.getApp().externalCacheDir 24 | CACHE_PATH = if (cacheDir != null) { 25 | cacheDir.absolutePath 26 | } else { 27 | Environment.getExternalStorageDirectory().absolutePath 28 | } + FILE_SEP 29 | TEST_APK_PATH = CACHE_PATH + "test_install.apk" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /feature/subutil/pkg/src/main/java/com/blankj/subutil/pkg/SubUtilApiImpl.java: -------------------------------------------------------------------------------- 1 | package com.blankj.subutil.pkg; 2 | 3 | import android.content.Context; 4 | 5 | import com.blankj.subutil.export.api.SubUtilApi; 6 | import com.blankj.subutil.pkg.feature.SubUtilActivity; 7 | import com.blankj.utilcode.util.ApiUtils; 8 | 9 | /** 10 | *
11 | * author: Blankj 12 | * blog : http://blankj.com 13 | * time : 2019/07/02 14 | * desc : 15 | *16 | */ 17 | @ApiUtils.Api 18 | public class SubUtilApiImpl extends SubUtilApi { 19 | 20 | @Override 21 | public void startSubUtilActivity(Context context) { 22 | SubUtilActivity.Companion.start(context); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /feature/utilcode/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /feature/utilcode/app/build.gradle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/feature/utilcode/app/build.gradle -------------------------------------------------------------------------------- /feature/utilcode/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /feature/utilcode/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 |
10 | * author: Blankj 11 | * blog : http://blankj.com 12 | * time : 2019/07/01 13 | * desc : 14 | *15 | */ 16 | public abstract class UtilCodeApi extends ApiUtils.BaseApi { 17 | 18 | public abstract void startUtilCodeActivity(Context context); 19 | 20 | public abstract void testCallback(Callback callback); 21 | 22 | public interface Callback { 23 | void call(); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /feature/utilcode/pkg/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /feature/utilcode/pkg/build.gradle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/feature/utilcode/pkg/build.gradle -------------------------------------------------------------------------------- /feature/utilcode/pkg/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 | -------------------------------------------------------------------------------- /feature/utilcode/pkg/src/main/assets/fonts/dnmbhs.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/feature/utilcode/pkg/src/main/assets/fonts/dnmbhs.ttf -------------------------------------------------------------------------------- /feature/utilcode/pkg/src/main/assets/test/sub/test.txt: -------------------------------------------------------------------------------- 1 | 1st line 2 | 2nd line -------------------------------------------------------------------------------- /feature/utilcode/pkg/src/main/assets/test/test.txt: -------------------------------------------------------------------------------- 1 | 1st line 2 | 2nd line -------------------------------------------------------------------------------- /feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/Config.kt: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.pkg 2 | 3 | import com.blankj.utilcode.util.PathUtils 4 | 5 | /** 6 | * ``` 7 | * author: Blankj 8 | * blog : http://blankj.com 9 | * time : 2017/05/10 10 | * desc : config about constants 11 | * ``` 12 | */ 13 | object Config { 14 | val FILE_SEP = System.getProperty("file.separator") 15 | val LINE_SEP = System.getProperty("line.separator") 16 | const val TEST_PKG = "com.blankj.testinstall" 17 | val CACHE_PATH = PathUtils.getCachePathExternalFirst() + FILE_SEP 18 | val TEST_APK_PATH: String = CACHE_PATH + "test_install.apk" 19 | } 20 | -------------------------------------------------------------------------------- /feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/UtilCodeApiImpl.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.pkg; 2 | 3 | import android.content.Context; 4 | 5 | import com.blankj.utilcode.export.api.UtilCodeApi; 6 | import com.blankj.utilcode.pkg.feature.CoreUtilActivity; 7 | import com.blankj.utilcode.util.ApiUtils; 8 | 9 | /** 10 | *
11 | * author: Blankj 12 | * blog : http://blankj.com 13 | * time : 2019/07/01 14 | * desc : 15 | *16 | */ 17 | @ApiUtils.Api 18 | public class UtilCodeApiImpl extends UtilCodeApi { 19 | 20 | @Override 21 | public void startUtilCodeActivity(Context context) { 22 | CoreUtilActivity.Companion.start(context); 23 | } 24 | 25 | @Override 26 | public void testCallback(Callback callback) { 27 | if (callback != null) { 28 | callback.call(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/adaptScreen/AdaptCloseActivity.kt: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.pkg.feature.adaptScreen 2 | 3 | import android.content.Context 4 | import android.content.Intent 5 | import android.content.res.Resources 6 | import android.os.Bundle 7 | import android.view.View 8 | import android.view.WindowManager 9 | import com.blankj.common.activity.CommonActivity 10 | import com.blankj.utilcode.pkg.R 11 | import com.blankj.utilcode.util.AdaptScreenUtils 12 | 13 | class AdaptCloseActivity : CommonActivity() { 14 | 15 | companion object { 16 | fun start(context: Context) { 17 | val starter = Intent(context, AdaptCloseActivity::class.java) 18 | context.startActivity(starter) 19 | } 20 | } 21 | 22 | override fun bindLayout(): Int { 23 | return R.layout.adaptscreen_close_activity 24 | } 25 | 26 | override fun initView(savedInstanceState: Bundle?, contentView: View?) { 27 | super.initView(savedInstanceState, contentView) 28 | window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN) 29 | } 30 | 31 | override fun getResources(): Resources { 32 | return AdaptScreenUtils.closeAdapt(super.getResources()) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/api/other/export/OtherModuleApi.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.pkg.feature.api.other.export; 2 | 3 | import com.blankj.utilcode.util.ApiUtils; 4 | 5 | /** 6 | *
7 | * author: Blankj 8 | * blog : http://blankj.com 9 | * time : 2019/07/10 10 | * desc : demo about ApiUtils 11 | *12 | */ 13 | public abstract class OtherModuleApi extends ApiUtils.BaseApi { 14 | 15 | public abstract void invokeWithParams(ApiBean bean); 16 | 17 | public abstract ApiBean invokeWithReturnValue(); 18 | 19 | public static class ApiBean { 20 | 21 | public String name; 22 | 23 | public ApiBean(String name) { 24 | this.name = name; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/api/other/pkg/OtherPkgApiImpl.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.pkg.feature.api.other.pkg; 2 | 3 | import com.blankj.utilcode.pkg.feature.api.other.export.OtherModuleApi; 4 | import com.blankj.utilcode.util.ApiUtils; 5 | import com.blankj.utilcode.util.ToastUtils; 6 | 7 | /** 8 | *
9 | * author: Blankj 10 | * blog : http://blankj.com 11 | * time : 2019/07/10 12 | * desc : demo about ApiUtils 13 | *14 | */ 15 | @ApiUtils.Api 16 | public class OtherPkgApiImpl extends OtherModuleApi { 17 | 18 | @Override 19 | public void invokeWithParams(ApiBean bean) { 20 | ToastUtils.showShort(bean.name); 21 | } 22 | 23 | @Override 24 | public ApiBean invokeWithReturnValue() { 25 | String value = "value"; 26 | return new ApiBean(value); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/bar/status/BarStatusActivityCustom.kt: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.pkg.feature.bar.status 2 | 3 | import android.content.Context 4 | import android.content.Intent 5 | import android.graphics.Color 6 | import android.os.Bundle 7 | import android.view.View 8 | import com.blankj.common.activity.CommonActivity 9 | import com.blankj.utilcode.pkg.R 10 | import com.blankj.utilcode.util.BarUtils 11 | 12 | 13 | /** 14 | * ``` 15 | * author: Blankj 16 | * blog : http://blankj.com 17 | * time : 2019/01/14 18 | * desc : demo about BarUtils 19 | * ``` 20 | */ 21 | class BarStatusActivityCustom : CommonActivity() { 22 | 23 | companion object { 24 | fun start(context: Context) { 25 | val starter = Intent(context, BarStatusActivityCustom::class.java) 26 | context.startActivity(starter) 27 | } 28 | } 29 | 30 | override fun initView(savedInstanceState: Bundle?, contentView: View?) { 31 | super.initView(savedInstanceState, contentView) 32 | BarUtils.setStatusBarColor(this, Color.TRANSPARENT).setBackgroundResource(R.drawable.bar_status_custom) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/bar/status/fragment/BarStatusFragmentCustom.kt: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.pkg.feature.bar.status.fragment 2 | 3 | import android.os.Bundle 4 | import android.view.View 5 | import com.blankj.common.fragment.CommonFragment 6 | import com.blankj.utilcode.pkg.R 7 | import com.blankj.utilcode.util.BarUtils 8 | import kotlinx.android.synthetic.main.bar_status_custom_fragment.* 9 | 10 | /** 11 | * ``` 12 | * author: Blankj 13 | * blog : http://blankj.com 14 | * time : 2017/07/01 15 | * desc : demo about BarUtils 16 | * ``` 17 | */ 18 | class BarStatusFragmentCustom : CommonFragment() { 19 | 20 | companion object { 21 | fun newInstance(): BarStatusFragmentCustom { 22 | return BarStatusFragmentCustom() 23 | } 24 | } 25 | 26 | override fun isLazy(): Boolean { 27 | return true 28 | } 29 | 30 | override fun bindLayout(): Int { 31 | return R.layout.bar_status_custom_fragment 32 | } 33 | 34 | override fun initView(savedInstanceState: Bundle?, contentView: View?) { 35 | super.initView(savedInstanceState, contentView) 36 | BarUtils.setStatusBarCustom(barStatusCustomFragmentFakeStatusBar) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/mvp/MvpActivity.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.pkg.feature.mvp; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | 8 | import com.blankj.common.activity.CommonActivity; 9 | import com.blankj.utilcode.pkg.R; 10 | 11 | import androidx.annotation.Nullable; 12 | 13 | /** 14 | *
15 | * author: blankj 16 | * blog : http://blankj.com 17 | * time : 2019/11/09 18 | * desc : 19 | *20 | */ 21 | public class MvpActivity extends CommonActivity { 22 | 23 | public static void start(Context context) { 24 | Intent starter = new Intent(context, MvpActivity.class); 25 | context.startActivity(starter); 26 | } 27 | 28 | @Override 29 | public int bindTitleRes() { 30 | return R.string.demo_mvp; 31 | } 32 | 33 | @Override 34 | public int bindLayout() { 35 | return R.layout.mvp_activity; 36 | } 37 | 38 | @Override 39 | public void initView(@Nullable Bundle savedInstanceState, @Nullable View contentView) { 40 | super.initView(savedInstanceState, contentView); 41 | new MvpView(this).addPresenter(new MvpPresenter()); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/mvp/MvpModel.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.pkg.feature.mvp; 2 | 3 | import com.blankj.base.mvp.BaseModel; 4 | import com.blankj.utilcode.util.ThreadUtils; 5 | import com.blankj.utilcode.util.Utils; 6 | 7 | /** 8 | *
9 | * author: blankj 10 | * blog : http://blankj.com 11 | * time : 2019/11/26 12 | * desc : 13 | *14 | */ 15 | public class MvpModel extends BaseModel implements MvpMvp.Model { 16 | 17 | private int index; 18 | 19 | @Override 20 | public void onCreate() { 21 | index = 0; 22 | } 23 | 24 | @Override 25 | public void requestUpdateMsg(final Utils.Consumer
7 | * author: blankj 8 | * blog : http://blankj.com 9 | * time : 2019/11/26 10 | * desc : 11 | *12 | */ 13 | public interface MvpMvp { 14 | 15 | interface View { 16 | void setLoadingVisible(boolean visible); 17 | 18 | void showMsg(CharSequence msg); 19 | } 20 | 21 | interface Presenter { 22 | void updateMsg(); 23 | } 24 | 25 | interface Model { 26 | void requestUpdateMsg(final Utils.Consumer
9 | * author: blankj 10 | * blog : http://blankj.com 11 | * time : 2019/11/26 12 | * desc : 13 | *14 | */ 15 | public class MvpPresenter extends BasePresenter
7 | * author: blankj 8 | * blog : http://blankj.com 9 | * time : 2019/09/09 10 | * desc : 11 | *12 | */ 13 | @Keep 14 | public class TestPrivateStaticFinal { 15 | public static final String STR = "str"; 16 | } 17 | -------------------------------------------------------------------------------- /feature/utilcode/pkg/src/main/res/anim/fade_in_1000.xml: -------------------------------------------------------------------------------- 1 | 2 |
13 | * author: Blankj 14 | * blog : http://blankj.com 15 | * time : 2018/11/16 16 | * desc : 17 | *18 | */ 19 | public interface IBaseView { 20 | 21 | void initData(@Nullable Bundle bundle); 22 | 23 | int bindLayout(); 24 | 25 | void setContentView(); 26 | 27 | void initView(@Nullable Bundle savedInstanceState, @Nullable View contentView); 28 | 29 | void doBusiness(); 30 | 31 | void onDebouncingClick(@NonNull View view); 32 | } 33 | -------------------------------------------------------------------------------- /lib/base/src/main/java/com/blankj/base/dialog/DialogCallback.java: -------------------------------------------------------------------------------- 1 | package com.blankj.base.dialog; 2 | 3 | import android.app.Activity; 4 | import android.app.Dialog; 5 | import android.view.Window; 6 | 7 | import androidx.annotation.NonNull; 8 | 9 | /** 10 | *
11 | * author: blankj 12 | * blog : http://blankj.com 13 | * time : 2019/11/12 14 | * desc : 15 | *16 | */ 17 | public interface DialogCallback { 18 | @NonNull 19 | Dialog bindDialog(Activity activity); 20 | 21 | void setWindowStyle(Window window); 22 | } 23 | -------------------------------------------------------------------------------- /lib/base/src/main/java/com/blankj/base/dialog/DialogLayoutCallback.java: -------------------------------------------------------------------------------- 1 | package com.blankj.base.dialog; 2 | 3 | import android.view.View; 4 | import android.view.Window; 5 | 6 | /** 7 | *
8 | * author: blankj 9 | * blog : http://blankj.com 10 | * time : 2019/11/12 11 | * desc : 12 | *13 | */ 14 | public interface DialogLayoutCallback { 15 | int bindTheme(); 16 | 17 | int bindLayout(); 18 | 19 | void initView(BaseDialogFragment dialog, View contentView); 20 | 21 | void setWindowStyle(Window window); 22 | 23 | void onCancel(BaseDialogFragment dialog); 24 | 25 | void onDismiss(BaseDialogFragment dialog); 26 | } 27 | -------------------------------------------------------------------------------- /lib/base/src/main/java/com/blankj/base/mvp/BaseModel.java: -------------------------------------------------------------------------------- 1 | package com.blankj.base.mvp; 2 | 3 | import android.util.Log; 4 | 5 | import androidx.annotation.CallSuper; 6 | 7 | /** 8 | *
9 | * author: blankj 10 | * blog : http://blankj.com 11 | * time : 2019/08/02 12 | * desc : 13 | *14 | */ 15 | public abstract class BaseModel { 16 | 17 | private static final String TAG = BaseView.TAG; 18 | 19 | public abstract void onCreate(); 20 | 21 | @CallSuper 22 | public void onDestroy() { 23 | Log.i(TAG, "destroy model: " + getClass().getSimpleName()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/base/src/main/java/com/blankj/base/view/EmptyGoneTextView.java: -------------------------------------------------------------------------------- 1 | package com.blankj.base.view; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.content.Context; 5 | import android.util.AttributeSet; 6 | import android.widget.TextView; 7 | 8 | import com.blankj.utilcode.util.StringUtils; 9 | 10 | import androidx.annotation.Nullable; 11 | 12 | /** 13 | *
14 | * author: blankj 15 | * blog : http://blankj.com 16 | * time : 2019/09/03 17 | * desc : 18 | *19 | */ 20 | @SuppressLint("AppCompatCustomView") 21 | public class EmptyGoneTextView extends TextView { 22 | 23 | public EmptyGoneTextView(Context context) { 24 | this(context, null); 25 | } 26 | 27 | public EmptyGoneTextView(Context context, @Nullable AttributeSet attrs) { 28 | super(context, attrs); 29 | setVisibility(GONE); 30 | } 31 | 32 | @Override 33 | protected void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter) { 34 | super.onTextChanged(text, start, lengthBefore, lengthAfter); 35 | if (StringUtils.isEmpty(text)) { 36 | setVisibility(GONE); 37 | } else { 38 | setVisibility(VISIBLE); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/base/src/main/res/layout/fragment_lazy.xml: -------------------------------------------------------------------------------- 1 | 2 |
7 | * author: Blankj 8 | * blog : http://blankj.com 9 | * time : 2019/06/05 10 | * desc : app about common 11 | *12 | */ 13 | public class CommonApplication extends BaseApplication { 14 | 15 | @Override 16 | public void onCreate() { 17 | super.onCreate(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/common/src/main/java/com/blankj/common/item/CommonItem.java: -------------------------------------------------------------------------------- 1 | package com.blankj.common.item; 2 | 3 | import com.blankj.base.rv.BaseItem; 4 | import com.blankj.base.rv.ItemViewHolder; 5 | import com.blankj.common.R; 6 | import com.blankj.utilcode.util.ColorUtils; 7 | 8 | import androidx.annotation.CallSuper; 9 | import androidx.annotation.NonNull; 10 | 11 | /** 12 | *
13 | * author: blankj 14 | * blog : http://blankj.com 15 | * time : 2019/10/25 16 | * desc : 17 | *18 | */ 19 | public class CommonItem
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2018/08/25 8 | * desc : utils about retrofit 9 | *10 | */ 11 | public final class RetrofitUtils { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /lib/subutil/src/main/java/com/blankj/subutil/util/TemperatureUtils.java: -------------------------------------------------------------------------------- 1 | package com.blankj.subutil.util; 2 | 3 | /** 4 | *
5 | * author: Faramarz Afzali 6 | * time : 2020/09/05 7 | * desc : This class is intended for converting temperatures into different units. 8 | * C refers to the Celsius unit 9 | * F refers to the Fahrenheit unit 10 | * K refers to the Kelvin unit 11 | *12 | */ 13 | public final class TemperatureUtils { 14 | 15 | public static float cToF(float temp) { 16 | return (temp * 9) / 5 + 32; 17 | } 18 | 19 | public static float cToK(float temp) { 20 | return temp + 273.15f; 21 | } 22 | 23 | 24 | public static float fToC(float temp) { 25 | return (temp - 32) * 5 / 9; 26 | } 27 | 28 | public static float fToK(float temp) { 29 | return temp + 255.3722222222f; 30 | } 31 | 32 | 33 | public static float kToC(float temp) { 34 | return temp - 273.15f; 35 | } 36 | 37 | public static float kToF(float temp) { 38 | return temp - 459.67f; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/subutil/src/main/java/com/blankj/subutil/util/http/Chain.java: -------------------------------------------------------------------------------- 1 | package com.blankj.subutil.util.http; 2 | 3 | public interface Chain { 4 | } 5 | -------------------------------------------------------------------------------- /lib/subutil/src/main/java/com/blankj/subutil/util/http/Headers.java: -------------------------------------------------------------------------------- 1 | package com.blankj.subutil.util.http; 2 | 3 | import java.util.HashMap; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | public class Headers { 8 | 9 | private Map
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2019/02/17 8 | *9 | */ 10 | public abstract class ResponseCallback { 11 | public abstract void onResponse(Response response); 12 | 13 | public abstract void onFailed(Exception e); 14 | } 15 | -------------------------------------------------------------------------------- /lib/subutil/src/test/java/com/blankj/subutil/util/BaseTest.java: -------------------------------------------------------------------------------- 1 | package com.blankj.subutil.util; 2 | 3 | 4 | import com.blankj.utilcode.util.Utils; 5 | 6 | import org.junit.Test; 7 | import org.junit.runner.RunWith; 8 | import org.robolectric.RobolectricTestRunner; 9 | import org.robolectric.RuntimeEnvironment; 10 | import org.robolectric.annotation.Config; 11 | import org.robolectric.shadows.ShadowLog; 12 | 13 | 14 | /** 15 | *
16 | * author: Blankj 17 | * blog : http://blankj.com 18 | * time : 2018/08/03 19 | * desc : 20 | *21 | */ 22 | @RunWith(RobolectricTestRunner.class) 23 | @Config(manifest = Config.NONE, shadows = {ShadowLog.class}) 24 | public class BaseTest { 25 | 26 | public BaseTest() { 27 | ShadowLog.stream = System.out; 28 | Utils.init(RuntimeEnvironment.application); 29 | } 30 | 31 | @Test 32 | public void test() throws Exception { 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/subutil/src/test/java/com/blankj/subutil/util/LunarUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.blankj.subutil.util; 2 | 3 | import org.junit.Test; 4 | 5 | /** 6 | *
7 | * author: Blankj 8 | * blog : http://blankj.com 9 | * time : 2018/04/08 10 | * desc : LunarUtils 单元测试 11 | *12 | */ 13 | public class LunarUtilsTest { 14 | 15 | @Test 16 | public void lunarYear2GanZhi() throws Exception { 17 | System.out.println(LunarUtils.lunarYear2GanZhi(2018)); 18 | } 19 | 20 | @Test 21 | public void lunar2Solar() throws Exception { 22 | System.out.println(LunarUtils.lunar2Solar(new LunarUtils.Lunar(2018, 2, 23, false))); 23 | } 24 | 25 | @Test 26 | public void solar2Lunar() throws Exception { 27 | System.out.println(LunarUtils.solar2Lunar(new LunarUtils.Solar(2018, 4, 8))); 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /lib/subutil/src/test/java/com/blankj/subutil/util/TestConfig.java: -------------------------------------------------------------------------------- 1 | package com.blankj.subutil.util; 2 | 3 | /** 4 | *
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2017/09/10 8 | * desc : config of test 9 | *10 | */ 11 | public class TestConfig { 12 | 13 | static final String FILE_SEP = System.getProperty("file.separator"); 14 | 15 | static final String LINE_SEP = System.getProperty("line.separator"); 16 | 17 | static final String TEST_PATH; 18 | 19 | static { 20 | String projectPath = System.getProperty("user.dir"); 21 | if (!projectPath.contains("subutil")) { 22 | projectPath += FILE_SEP + "subutil"; 23 | } 24 | TEST_PATH = projectPath + FILE_SEP + "src" + FILE_SEP + "test" + FILE_SEP + "res"; 25 | } 26 | 27 | 28 | public static final String PATH_HTTP = TEST_PATH + "http" + FILE_SEP; 29 | } 30 | -------------------------------------------------------------------------------- /lib/subutil/src/test/java/com/blankj/subutil/util/http/UserBean.java: -------------------------------------------------------------------------------- 1 | package com.blankj.subutil.util.http; 2 | 3 | /** 4 | *
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2019/02/17 8 | * desc : 9 | *10 | */ 11 | class UserBean { 12 | 13 | private String name; 14 | private String password; 15 | private String profession; 16 | private int id; 17 | 18 | public String getName() { 19 | return name; 20 | } 21 | 22 | public void setName(String name) { 23 | this.name = name; 24 | } 25 | 26 | public String getPassword() { 27 | return password; 28 | } 29 | 30 | public void setPassword(String password) { 31 | this.password = password; 32 | } 33 | 34 | public String getProfession() { 35 | return profession; 36 | } 37 | 38 | public void setProfession(String profession) { 39 | this.profession = profession; 40 | } 41 | 42 | public int getId() { 43 | return id; 44 | } 45 | 46 | public void setId(int id) { 47 | this.id = id; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/utilcode/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /lib/utilcode/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in G:\Android_IDE\ADT\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -dontwarn com.blankj.utilcode.** 19 | 20 | -keepclassmembers class * { 21 | @com.blankj.utilcode.util.BusUtils$Bus
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2018/06/13 8 | * desc : constants of cache 9 | *10 | */ 11 | public interface CacheConstants { 12 | int SEC = 1; 13 | int MIN = 60; 14 | int HOUR = 3600; 15 | int DAY = 86400; 16 | } 17 | -------------------------------------------------------------------------------- /lib/utilcode/src/main/java/com/blankj/utilcode/constant/MemoryConstants.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.constant; 2 | 3 | import androidx.annotation.IntDef; 4 | 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | 8 | /** 9 | *
10 | * author: Blankj 11 | * blog : http://blankj.com 12 | * time : 2017/03/13 13 | * desc : constants of memory 14 | *15 | */ 16 | public final class MemoryConstants { 17 | 18 | public static final int BYTE = 1; 19 | public static final int KB = 1024; 20 | public static final int MB = 1048576; 21 | public static final int GB = 1073741824; 22 | 23 | @IntDef({BYTE, KB, MB, GB}) 24 | @Retention(RetentionPolicy.SOURCE) 25 | public @interface Unit { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/utilcode/src/main/java/com/blankj/utilcode/constant/TimeConstants.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.constant; 2 | 3 | import androidx.annotation.IntDef; 4 | 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | 8 | /** 9 | *
10 | * author: Blankj 11 | * blog : http://blankj.com 12 | * time : 2017/03/13 13 | * desc : constants of time 14 | *15 | */ 16 | public final class TimeConstants { 17 | 18 | public static final int MSEC = 1; 19 | public static final int SEC = 1000; 20 | public static final int MIN = 60000; 21 | public static final int HOUR = 3600000; 22 | public static final int DAY = 86400000; 23 | 24 | @IntDef({MSEC, SEC, MIN, HOUR, DAY}) 25 | @Retention(RetentionPolicy.SOURCE) 26 | public @interface Unit { 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/utilcode/src/main/java/com/blankj/utilcode/util/CloneUtils.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.util; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | /** 6 | *
7 | * author: Blankj 8 | * blog : http://blankj.com 9 | * time : 2018/01/30 10 | * desc : utils about clone 11 | *12 | */ 13 | public final class CloneUtils { 14 | 15 | private CloneUtils() { 16 | throw new UnsupportedOperationException("u can't instantiate me..."); 17 | } 18 | 19 | /** 20 | * Deep clone. 21 | * 22 | * @param data The data. 23 | * @param type The type. 24 | * @param
9 | * author: blankj 10 | * blog : http://blankj.com 11 | * time : 2020/03/19 12 | * desc : 13 | *14 | */ 15 | public class UtilsFileProvider extends FileProvider { 16 | 17 | @Override 18 | public boolean onCreate() { 19 | //noinspection ConstantConditions 20 | Utils.init((Application) getContext().getApplicationContext()); 21 | return true; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/utilcode/src/main/res/drawable/utils_toast_bg.xml: -------------------------------------------------------------------------------- 1 | 2 |
8 | * author: Blankj 9 | * blog : http://blankj.com 10 | * time : 2019/07/11 11 | * desc : 12 | *13 | */ 14 | public class ApiUtilsTest extends BaseTest { 15 | 16 | @Before 17 | public void setUp() throws Exception { 18 | ApiUtils.register(TestApiImpl.class); 19 | } 20 | 21 | @Test 22 | public void getApi() { 23 | System.out.println("ApiUtils.getApi(TestApi.class).test(\"hehe\") = " + ApiUtils.getApi(TestApi.class).test("hehe")); 24 | } 25 | 26 | @Test 27 | public void toString_() { 28 | System.out.println("ApiUtils.toString_() = " + ApiUtils.toString_()); 29 | } 30 | 31 | @ApiUtils.Api 32 | public static class TestApiImpl extends TestApi { 33 | 34 | @Override 35 | public String test(String param) { 36 | System.out.println("param = " + param); 37 | return "haha"; 38 | } 39 | 40 | } 41 | 42 | public static abstract class TestApi extends ApiUtils.BaseApi { 43 | 44 | public abstract String test(String name); 45 | 46 | } 47 | } -------------------------------------------------------------------------------- /lib/utilcode/src/test/java/com/blankj/utilcode/util/PathUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.util; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | 7 | /** 8 | *
9 | * author: blankj 10 | * blog : http://blankj.com 11 | * time : 2020/04/09 12 | * desc : 13 | *14 | */ 15 | public class PathUtilsTest extends BaseTest { 16 | 17 | @Test 18 | public void join() { 19 | assertEquals(PathUtils.join("", ""), ""); 20 | assertEquals(PathUtils.join("", "data"), "/data"); 21 | 22 | assertEquals(PathUtils.join("", "//data"), "/data"); 23 | assertEquals(PathUtils.join("", "data//"), "/data"); 24 | assertEquals(PathUtils.join("", "//data//"), "/data"); 25 | 26 | assertEquals(PathUtils.join("/sdcard", "data"), "/sdcard/data"); 27 | assertEquals(PathUtils.join("/sdcard/", "data"), "/sdcard/data"); 28 | } 29 | } -------------------------------------------------------------------------------- /lib/utilcode/src/test/java/com/blankj/utilcode/util/reflect/PrivateConstructors.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.util.reflect; 2 | 3 | /** 4 | *
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2018/01/12 8 | * desc : 9 | *10 | */ 11 | public class PrivateConstructors { 12 | 13 | public final String string; 14 | 15 | private PrivateConstructors() { 16 | this(null); 17 | } 18 | 19 | private PrivateConstructors(String string) { 20 | this.string = string; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/utilcode/src/test/java/com/blankj/utilcode/util/reflect/Test1.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.util.reflect; 2 | 3 | /** 4 | *
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2018/01/12 8 | * desc : 9 | *10 | */ 11 | public class Test1 { 12 | public static int S_INT1; 13 | public static Integer S_INT2; 14 | public int I_INT1; 15 | public Integer I_INT2; 16 | 17 | public static Test1 S_DATA; 18 | public Test1 I_DATA; 19 | } 20 | -------------------------------------------------------------------------------- /lib/utilcode/src/test/java/com/blankj/utilcode/util/reflect/Test10.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.util.reflect; 2 | 3 | /** 4 | *
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2018/05/03 8 | * desc : 9 | *10 | */ 11 | public interface Test10 { 12 | 13 | void setFoo(String s); 14 | 15 | void setBar(boolean b); 16 | 17 | void setBaz(String baz); 18 | 19 | void testIgnore(); 20 | 21 | String getFoo(); 22 | 23 | boolean isBar(); 24 | 25 | String getBaz(); 26 | } 27 | -------------------------------------------------------------------------------- /lib/utilcode/src/test/java/com/blankj/utilcode/util/reflect/Test2.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.util.reflect; 2 | 3 | /** 4 | *
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2018/01/12 8 | * desc : 9 | *10 | */ 11 | public class Test2 { 12 | 13 | public final Object n; 14 | public final ConstructorType constructorType; 15 | 16 | public Test2() { 17 | this.n = null; 18 | this.constructorType = ConstructorType.NO_ARGS; 19 | } 20 | 21 | public Test2(Integer n) { 22 | this.n = n; 23 | this.constructorType = ConstructorType.INTEGER; 24 | } 25 | 26 | public Test2(Number n) { 27 | this.n = n; 28 | this.constructorType = ConstructorType.NUMBER; 29 | } 30 | 31 | public Test2(Object n) { 32 | this.n = n; 33 | this.constructorType = ConstructorType.OBJECT; 34 | } 35 | 36 | public static enum ConstructorType { 37 | NO_ARGS, 38 | INTEGER, 39 | NUMBER, 40 | OBJECT 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/utilcode/src/test/java/com/blankj/utilcode/util/reflect/Test3.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.util.reflect; 2 | 3 | /** 4 | *
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2018/01/12 8 | * desc : 9 | *10 | */ 11 | public class Test3 { 12 | 13 | public Object n; 14 | public MethodType methodType; 15 | 16 | public void method() { 17 | this.n = null; 18 | this.methodType = MethodType.NO_ARGS; 19 | } 20 | 21 | public void method(Integer n1) { 22 | this.n = n1; 23 | this.methodType = MethodType.INTEGER; 24 | } 25 | 26 | public void method(Number n1) { 27 | this.n = n1; 28 | this.methodType = MethodType.NUMBER; 29 | } 30 | 31 | public void method(Object n1) { 32 | this.n = n1; 33 | this.methodType = MethodType.OBJECT; 34 | } 35 | 36 | public static enum MethodType { 37 | NO_ARGS, 38 | INTEGER, 39 | NUMBER, 40 | OBJECT 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/utilcode/src/test/java/com/blankj/utilcode/util/reflect/Test4.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.util.reflect; 2 | 3 | /** 4 | *
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2018/01/12 8 | * desc : 9 | *10 | */ 11 | public class Test4 { 12 | 13 | public static void s_method() { 14 | } 15 | 16 | public void i_method() { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/utilcode/src/test/java/com/blankj/utilcode/util/reflect/Test5.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.util.reflect; 2 | 3 | /** 4 | *
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2018/01/12 8 | * desc : 9 | *10 | */ 11 | public class Test5 { 12 | 13 | private static void s_method() { 14 | } 15 | 16 | private void i_method() { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/utilcode/src/test/java/com/blankj/utilcode/util/reflect/Test6.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.util.reflect; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | *
8 | * author: Blankj 9 | * blog : http://blankj.com 10 | * time : 2018/01/12 11 | * desc : 12 | *13 | */ 14 | public class Test6 { 15 | public Map
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2018/01/12 8 | * desc : 9 | *10 | */ 11 | public class Test7 { 12 | 13 | public final String s; 14 | public final Integer i; 15 | 16 | private Test7(int i) { 17 | this(null, i); 18 | } 19 | 20 | private Test7(String s) { 21 | this(s, null); 22 | } 23 | 24 | private Test7(String s, int i) { 25 | this(s, (Integer) i); 26 | } 27 | 28 | private Test7(String s, Integer i) { 29 | this.s = s; 30 | this.i = i; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/utilcode/src/test/java/com/blankj/utilcode/util/reflect/Test8.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.util.reflect; 2 | 3 | /** 4 | *
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2018/01/12 8 | * desc : 9 | *10 | */ 11 | public class Test8 { 12 | 13 | 14 | public static final int SF_INT1 = new Integer(0); 15 | public static final Integer SF_INT2 = new Integer(0); 16 | public final int F_INT1 = new Integer(0); 17 | public final Integer F_INT2 = new Integer(0); 18 | 19 | public static Test8 S_DATA; 20 | public Test8 I_DATA; 21 | } 22 | -------------------------------------------------------------------------------- /lib/utilcode/src/test/java/com/blankj/utilcode/util/reflect/Test9.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.util.reflect; 2 | 3 | /** 4 | *
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2018/05/03 8 | * desc : 9 | *10 | */ 11 | public interface Test9 { 12 | String substring(int beginIndex); 13 | 14 | String substring(int beginIndex, int endIndex); 15 | 16 | String substring(Integer beginIndex); 17 | 18 | String substring(Integer beginIndex, Integer endIndex); 19 | } 20 | -------------------------------------------------------------------------------- /lib/utilcode/src/test/java/com/blankj/utilcode/util/reflect/TestHierarchicalMethodsBase.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.util.reflect; 2 | 3 | /** 4 | *
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2018/01/12 8 | * desc : 9 | *10 | */ 11 | public class TestHierarchicalMethodsBase { 12 | 13 | public static String PUBLIC_RESULT = "PUBLIC_BASE"; 14 | public static String PRIVATE_RESULT = "PRIVATE_BASE"; 15 | 16 | private int invisibleField1; 17 | private int invisibleField2; 18 | public int visibleField1; 19 | public int visibleField2; 20 | 21 | public String pub_base_method(int number) { 22 | return PUBLIC_RESULT; 23 | } 24 | 25 | public String pub_method(int number) { 26 | return PUBLIC_RESULT; 27 | } 28 | 29 | private String priv_method(int number) { 30 | return PRIVATE_RESULT; 31 | } 32 | 33 | private String very_priv_method() { 34 | return PRIVATE_RESULT; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/utilcode/src/test/java/com/blankj/utilcode/util/reflect/TestHierarchicalMethodsSubclass.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.util.reflect; 2 | 3 | /** 4 | *
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2018/01/12 8 | * desc : 9 | *10 | */ 11 | public class TestHierarchicalMethodsSubclass extends TestHierarchicalMethodsBase { 12 | 13 | public static String PUBLIC_RESULT = "PUBLIC_SUB"; 14 | public static String PRIVATE_RESULT = "PRIVATE_SUB"; 15 | 16 | // Both of these are hiding fields in the super type 17 | private int invisibleField2; 18 | public int visibleField2; 19 | 20 | private int invisibleField3; 21 | public int visibleField3; 22 | 23 | private String priv_method(int number) { 24 | return PRIVATE_RESULT; 25 | } 26 | 27 | private String pub_method(Integer number) { 28 | return PRIVATE_RESULT; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/utilcode/src/test/java/com/blankj/utilcode/util/reflect/TestPrivateStaticFinal.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utilcode.util.reflect; 2 | 3 | /** 4 | *
5 | * author: Blankj 6 | * blog : http://blankj.com 7 | * time : 2018/01/12 8 | * desc : 9 | *10 | */ 11 | public class TestPrivateStaticFinal { 12 | private static final int I1 = new Integer(1); 13 | private static final Integer I2 = new Integer(1); 14 | } 15 | -------------------------------------------------------------------------------- /lib/utilcode/src/test/res/encrypt/MD5.txt: -------------------------------------------------------------------------------- 1 | MD5 -------------------------------------------------------------------------------- /lib/utilcode/src/test/res/file/GBK.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/lib/utilcode/src/test/res/file/GBK.txt -------------------------------------------------------------------------------- /lib/utilcode/src/test/res/file/UTF16BE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/lib/utilcode/src/test/res/file/UTF16BE.txt -------------------------------------------------------------------------------- /lib/utilcode/src/test/res/file/UTF8.txt: -------------------------------------------------------------------------------- 1 | UTF8 2 | 2 3 | 3 4 | 4 5 | 5 6 | 6 7 | 7 -------------------------------------------------------------------------------- /lib/utilcode/src/test/res/file/Unicode.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/lib/utilcode/src/test/res/file/Unicode.txt -------------------------------------------------------------------------------- /lib/utilcode/src/test/res/file/recuresive/UTF8.txt: -------------------------------------------------------------------------------- 1 | UTF8 2 | 2 3 | 3 4 | 4 5 | 5 6 | 6 7 | 7 -------------------------------------------------------------------------------- /lib/utilcode/src/test/res/image/ic_launcher.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/lib/utilcode/src/test/res/image/ic_launcher.bmp -------------------------------------------------------------------------------- /lib/utilcode/src/test/res/image/ic_launcher.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/lib/utilcode/src/test/res/image/ic_launcher.gif -------------------------------------------------------------------------------- /lib/utilcode/src/test/res/image/ic_launcher.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/lib/utilcode/src/test/res/image/ic_launcher.ico -------------------------------------------------------------------------------- /lib/utilcode/src/test/res/image/ic_launcher.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/lib/utilcode/src/test/res/image/ic_launcher.jpg -------------------------------------------------------------------------------- /lib/utilcode/src/test/res/image/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/lib/utilcode/src/test/res/image/ic_launcher.png -------------------------------------------------------------------------------- /lib/utilcode/src/test/res/image/ic_launcher.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/lib/utilcode/src/test/res/image/ic_launcher.tif -------------------------------------------------------------------------------- /lib/utilcode/src/test/res/image/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/lib/utilcode/src/test/res/image/ic_launcher.webp -------------------------------------------------------------------------------- /lib/utilcode/src/test/res/zip/test.txt: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /lib/utilcode/src/test/res/zip/testDir/test.txt: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /lib/utilcode/src/test/res/zip/测试.txt: -------------------------------------------------------------------------------- 1 | 测试 -------------------------------------------------------------------------------- /lib/utilcode/src/test/res/zip/测试文件夹/测试.txt: -------------------------------------------------------------------------------- 1 | 测试 -------------------------------------------------------------------------------- /lib/utildebug-no-op/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /lib/utildebug-no-op/build.gradle: -------------------------------------------------------------------------------- 1 | apply { 2 | } 3 | 4 | dependencies { 5 | 6 | } -------------------------------------------------------------------------------- /lib/utildebug-no-op/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 | -------------------------------------------------------------------------------- /lib/utildebug-no-op/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |
9 | * author: blankj 10 | * blog : http://blankj.com 11 | * time : 2019/08/28 12 | * desc : utils about debug 13 | *14 | */ 15 | public class DebugUtils { 16 | 17 | private DebugUtils() { 18 | throw new UnsupportedOperationException("u can't instantiate me..."); 19 | } 20 | 21 | public static void setIconId(final int icon) { 22 | } 23 | 24 | public static void addDebugs(final List
8 | * author: blankj 9 | * blog : http://blankj.com 10 | * time : 2019/08/28 11 | * desc : 12 | *13 | */ 14 | public interface IDebug { 15 | 16 | void onAppCreate(Context context); 17 | 18 | int getCategory(); 19 | 20 | int getIcon(); 21 | 22 | int getName(); 23 | 24 | void onClick(View view); 25 | 26 | int TOOLS = 0; 27 | int PERFORMANCE = 1; 28 | int UI = 2; 29 | int BIZ = 3; 30 | } 31 | -------------------------------------------------------------------------------- /lib/utildebug/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /lib/utildebug/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compileOnly Config.libs.androidx_appcompat.path 3 | compileOnly Config.libs.androidx_material.path 4 | 5 | implementation Config.modules.lib_utilcode.dep 6 | implementation Config.libs.swipe_panel.path 7 | implementation Config.libs.photo_view.path 8 | 9 | testImplementation Config.libs.test_junit.path 10 | testImplementation Config.libs.test_robolectric.path 11 | testImplementation Config.libs.androidx_appcompat.path 12 | } -------------------------------------------------------------------------------- /lib/utildebug/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 | -------------------------------------------------------------------------------- /lib/utildebug/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |
14 | * author: blankj 15 | * blog : http://blankj.com 16 | * time : 2019/09/03 17 | * desc : 18 | *19 | */ 20 | @SuppressLint("AppCompatCustomView") 21 | public class EmptyGoneTextView extends TextView { 22 | 23 | public EmptyGoneTextView(Context context) { 24 | this(context, null); 25 | } 26 | 27 | public EmptyGoneTextView(Context context, @Nullable AttributeSet attrs) { 28 | super(context, attrs); 29 | setVisibility(GONE); 30 | } 31 | 32 | @Override 33 | protected void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter) { 34 | super.onTextChanged(text, start, lengthBefore, lengthAfter); 35 | if (StringUtils.isEmpty(text)) { 36 | setVisibility(GONE); 37 | } else { 38 | setVisibility(VISIBLE); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/utildebug/src/main/java/com/blankj/utildebug/base/view/listener/OnBackListener.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utildebug.base.view.listener; 2 | 3 | /** 4 | *
5 | * author: blankj 6 | * blog : http://blankj.com 7 | * time : 2019/09/20 8 | * desc : 9 | *10 | */ 11 | public interface OnBackListener { 12 | void onBack(); 13 | } 14 | -------------------------------------------------------------------------------- /lib/utildebug/src/main/java/com/blankj/utildebug/base/view/listener/OnRefreshListener.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utildebug.base.view.listener; 2 | 3 | import com.blankj.utildebug.base.view.BaseContentFloatView; 4 | 5 | /** 6 | *
7 | * author: blankj 8 | * blog : http://blankj.com 9 | * time : 2019/09/20 10 | * desc : 11 | *12 | */ 13 | public interface OnRefreshListener { 14 | void onRefresh(BaseContentFloatView floatView); 15 | } 16 | -------------------------------------------------------------------------------- /lib/utildebug/src/main/java/com/blankj/utildebug/debug/IDebug.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utildebug.debug; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | 9 | import androidx.annotation.DrawableRes; 10 | import androidx.annotation.IntDef; 11 | import androidx.annotation.StringRes; 12 | 13 | /** 14 | *
15 | * author: blankj 16 | * blog : http://blankj.com 17 | * time : 2019/08/28 18 | * desc : 19 | *20 | */ 21 | public interface IDebug { 22 | 23 | void onAppCreate(Context context); 24 | 25 | @Category 26 | int getCategory(); 27 | 28 | @DrawableRes 29 | int getIcon(); 30 | 31 | @StringRes 32 | int getName(); 33 | 34 | void onClick(View view); 35 | 36 | int TOOLS = 0; 37 | int PERFORMANCE = 1; 38 | int UI = 2; 39 | int BIZ = 3; 40 | 41 | @IntDef({TOOLS, PERFORMANCE, UI, BIZ}) 42 | @Retention(RetentionPolicy.SOURCE) 43 | @interface Category { 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/utildebug/src/main/java/com/blankj/utildebug/debug/tool/appInfo/AppInfoDebug.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utildebug.debug.tool.appInfo; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | 6 | import com.blankj.utilcode.util.AppUtils; 7 | import com.blankj.utildebug.R; 8 | import com.blankj.utildebug.debug.tool.AbsToolDebug; 9 | import com.blankj.utildebug.menu.DebugMenu; 10 | 11 | /** 12 | *
13 | * author: blankj 14 | * blog : http://blankj.com 15 | * time : 2019/09/02 16 | * desc : 17 | *18 | */ 19 | public class AppInfoDebug extends AbsToolDebug { 20 | 21 | @Override 22 | public void onAppCreate(Context context) { 23 | 24 | } 25 | 26 | @Override 27 | public int getIcon() { 28 | int appIconId = AppUtils.getAppIconId(); 29 | if (appIconId != 0) return appIconId; 30 | return R.drawable.du_ic_debug_app_info_default; 31 | } 32 | 33 | @Override 34 | public int getName() { 35 | return R.string.du_app_info; 36 | } 37 | 38 | @Override 39 | public void onClick(View view) { 40 | DebugMenu.getInstance().dismiss(); 41 | new AppInfoFloatView().show(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/utildebug/src/main/java/com/blankj/utildebug/debug/tool/clearStorage/ClearStorageDebug.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utildebug.debug.tool.clearStorage; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | 6 | import com.blankj.utilcode.util.AppUtils; 7 | import com.blankj.utilcode.util.ShellUtils; 8 | import com.blankj.utildebug.R; 9 | import com.blankj.utildebug.debug.tool.AbsToolDebug; 10 | 11 | /** 12 | *
13 | * author: blankj 14 | * blog : http://blankj.com 15 | * time : 2019/09/04 16 | * desc : 17 | *18 | */ 19 | public class ClearStorageDebug extends AbsToolDebug { 20 | 21 | @Override 22 | public void onAppCreate(Context context) { 23 | 24 | } 25 | 26 | @Override 27 | public int getIcon() { 28 | return R.drawable.du_ic_debug_clear_storage; 29 | } 30 | 31 | @Override 32 | public int getName() { 33 | return R.string.du_clear_storage; 34 | } 35 | 36 | @Override 37 | public void onClick(View view) { 38 | ShellUtils.execCmd("pm clear " + AppUtils.getAppPackageName(), false); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/utildebug/src/main/java/com/blankj/utildebug/debug/tool/deviceInfo/DeviceInfoDebug.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utildebug.debug.tool.deviceInfo; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | 6 | import com.blankj.utildebug.R; 7 | import com.blankj.utildebug.debug.tool.AbsToolDebug; 8 | import com.blankj.utildebug.menu.DebugMenu; 9 | 10 | /** 11 | *
12 | * author: blankj 13 | * blog : http://blankj.com 14 | * time : 2019/09/02 15 | * desc : 16 | *17 | */ 18 | public class DeviceInfoDebug extends AbsToolDebug { 19 | 20 | @Override 21 | public void onAppCreate(Context context) { 22 | 23 | } 24 | 25 | @Override 26 | public int getIcon() { 27 | return R.drawable.du_ic_debug_device_info; 28 | } 29 | 30 | @Override 31 | public int getName() { 32 | return R.string.du_device_info; 33 | } 34 | 35 | @Override 36 | public void onClick(View view) { 37 | DebugMenu.getInstance().dismiss(); 38 | new DeviceInfoFloatView().show(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/utildebug/src/main/java/com/blankj/utildebug/debug/tool/fileExplorer/FileExplorerDebug.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utildebug.debug.tool.fileExplorer; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | 6 | import com.blankj.utildebug.R; 7 | import com.blankj.utildebug.debug.tool.AbsToolDebug; 8 | import com.blankj.utildebug.menu.DebugMenu; 9 | 10 | /** 11 | *
12 | * author: blankj 13 | * blog : http://blankj.com 14 | * time : 2019/09/04 15 | * desc : 16 | *17 | */ 18 | public class FileExplorerDebug extends AbsToolDebug { 19 | 20 | @Override 21 | public void onAppCreate(Context context) { 22 | 23 | } 24 | 25 | @Override 26 | public int getIcon() { 27 | return R.drawable.du_ic_debug_file_explorer; 28 | } 29 | 30 | @Override 31 | public int getName() { 32 | return R.string.du_file_explorer; 33 | } 34 | 35 | @Override 36 | public void onClick(View view) { 37 | DebugMenu.getInstance().dismiss(); 38 | new FileExplorerFloatView().show(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/utildebug/src/main/java/com/blankj/utildebug/debug/tool/fileExplorer/FileExplorerFloatView.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utildebug.debug.tool.fileExplorer; 2 | 3 | import com.blankj.utildebug.R; 4 | import com.blankj.utildebug.base.view.BaseContentFloatView; 5 | 6 | /** 7 | *
8 | * author: blankj 9 | * blog : http://blankj.com 10 | * time : 2019/09/04 11 | * desc : 12 | *13 | */ 14 | public class FileExplorerFloatView extends BaseContentFloatView
5 | * author: blankj 6 | * blog : http://blankj.com 7 | * time : 2019/09/08 8 | * desc : 9 | *10 | */ 11 | public class TextViewer { 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /lib/utildebug/src/main/java/com/blankj/utildebug/debug/tool/logcat/LogcatDebug.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utildebug.debug.tool.logcat; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | 6 | import com.blankj.utildebug.R; 7 | import com.blankj.utildebug.base.view.FloatToast; 8 | import com.blankj.utildebug.debug.tool.AbsToolDebug; 9 | 10 | /** 11 | *
12 | * author: blankj 13 | * blog : http://blankj.com 14 | * time : 2019/09/05 15 | * desc : 16 | *17 | */ 18 | public class LogcatDebug extends AbsToolDebug { 19 | @Override 20 | public void onAppCreate(Context context) { 21 | 22 | } 23 | 24 | @Override 25 | public int getIcon() { 26 | return R.drawable.du_ic_debug_logcat; 27 | } 28 | 29 | @Override 30 | public int getName() { 31 | return R.string.du_logcat; 32 | } 33 | 34 | @Override 35 | public void onClick(View view) { 36 | FloatToast.showShort(FloatToast.WARNING, "Developing..."); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/utildebug/src/main/java/com/blankj/utildebug/debug/tool/restartApp/RestartAppDebug.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utildebug.debug.tool.restartApp; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | 6 | import com.blankj.utilcode.util.AppUtils; 7 | import com.blankj.utildebug.R; 8 | import com.blankj.utildebug.debug.tool.AbsToolDebug; 9 | 10 | /** 11 | *
12 | * author: blankj 13 | * blog : http://blankj.com 14 | * time : 2019/09/04 15 | * desc : 16 | *17 | */ 18 | public class RestartAppDebug extends AbsToolDebug { 19 | 20 | @Override 21 | public void onAppCreate(Context context) { 22 | 23 | } 24 | 25 | @Override 26 | public int getIcon() { 27 | return R.drawable.du_ic_debug_restart_app; 28 | } 29 | 30 | @Override 31 | public int getName() { 32 | return R.string.du_restart_app; 33 | } 34 | 35 | @Override 36 | public void onClick(View view) { 37 | AppUtils.relaunchApp(true); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/utildebug/src/main/java/com/blankj/utildebug/helper/ShadowHelper.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utildebug.helper; 2 | 3 | import android.view.View; 4 | 5 | import com.blankj.utilcode.util.ShadowUtils; 6 | import com.blankj.utilcode.util.SizeUtils; 7 | 8 | /** 9 | *
10 | * author: blankj 11 | * blog : http://blankj.com 12 | * time : 2019/09/16 13 | * desc : 14 | *15 | */ 16 | public class ShadowHelper { 17 | 18 | public static void applyDebugIcon(View view) { 19 | ShadowUtils.apply(view, new ShadowUtils.Config() 20 | .setCircle() 21 | .setShadowColor(0xc0_ffffff, 0x60_ffffff) 22 | ); 23 | } 24 | 25 | public static void applyFloatView(View view) { 26 | ShadowUtils.apply(view, new ShadowUtils.Config().setShadowRadius(SizeUtils.dp2px(8))); 27 | } 28 | 29 | public static void applyMenu(View view) { 30 | ShadowUtils.apply(view, new ShadowUtils.Config() 31 | .setShadowRadius(SizeUtils.dp2px(4)) 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/utildebug/src/main/java/com/blankj/utildebug/helper/WindowHelper.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utildebug.helper; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | import android.view.WindowManager; 7 | 8 | import com.blankj.utilcode.util.ScreenUtils; 9 | import com.blankj.utilcode.util.Utils; 10 | 11 | /** 12 | *
13 | * author: blankj 14 | * blog : http://blankj.com 15 | * time : 2019/08/29 16 | * desc : 17 | *18 | */ 19 | public class WindowHelper { 20 | 21 | private static WindowManager sWM; 22 | 23 | private WindowHelper() { 24 | } 25 | 26 | public static void updateViewLayout(final View view, ViewGroup.LayoutParams params) { 27 | getWindowManager().updateViewLayout(view, params); 28 | } 29 | 30 | public static int getAppWindowHeight() { 31 | return ScreenUtils.getAppScreenHeight(); 32 | } 33 | 34 | public static WindowManager getWindowManager() { 35 | if (sWM == null) { 36 | sWM = (WindowManager) Utils.getApp().getSystemService(Context.WINDOW_SERVICE); 37 | } 38 | return sWM; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/utildebug/src/main/java/com/blankj/utildebug/menu/ReminderView.java: -------------------------------------------------------------------------------- 1 | package com.blankj.utildebug.menu; 2 | 3 | import android.widget.Switch; 4 | 5 | import com.blankj.utildebug.R; 6 | import com.blankj.utildebug.base.view.BaseContentFloatView; 7 | import com.blankj.utildebug.config.DebugConfig; 8 | 9 | /** 10 | *
11 | * author: blankj 12 | * blog : http://blankj.com 13 | * time : 2019/09/10 14 | * desc : 15 | *16 | */ 17 | public class ReminderView extends BaseContentFloatView
5 | * author: blankj 6 | * blog : http://blankj.com 7 | * time : 2019/07/14 8 | * desc : 9 | *10 | */ 11 | public class ApiInfo { 12 | 13 | public String implApiClass; 14 | public boolean isMock; 15 | 16 | public ApiInfo(String implApiClass, boolean isMock) { 17 | this.implApiClass = implApiClass; 18 | this.isMock = isMock; 19 | } 20 | 21 | @Override 22 | public String toString() { 23 | return "{ implApiClass: " + implApiClass + 24 | ", isMock: " + isMock + 25 | " }"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /plugin/api-gradle-plugin/src/main/java/com/blankj/api/Config.groovy: -------------------------------------------------------------------------------- 1 | package com.blankj.api 2 | 3 | import com.blankj.base_transform.BaseTransformConfig 4 | 5 | class Config { 6 | 7 | public static final String EXT_NAME = 'api' 8 | 9 | public static final List
8 | * author: Blankj 9 | * blog : http://blankj.com 10 | * time : 2018/10/08 11 | * desc : 12 | *13 | */ 14 | final class JsonUtils { 15 | 16 | static final Gson GSON = new GsonBuilder().setPrettyPrinting().create() 17 | 18 | static String getFormatJson(Object object) { 19 | return GSON.toJson(object) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /script/runDevDebug.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # build dev debug apk 6 | ./gradlew --daemon installDevDebug 7 | 8 | # start main activity 9 | adb shell am start -n "com.blankj.androidutilcode.dev/com.blankj.main.pkg.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -------------------------------------------------------------------------------- /script/runProductionRelease.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # build dev debug apk 6 | ./gradlew --daemon installProductionRelease 7 | 8 | # start main activity 9 | adb shell am start -n "com.blankj.androidutilcode/com.blankj.main.pkg.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | //includeBuild 'configPlugin' 2 | 3 | //buildscript { 4 | //// ConfigUtils.init(gradle) 5 | // repositories { 6 | // mavenLocal() 7 | // mavenCentral() 8 | // } 9 | // 10 | // dependencies { 11 | // classpath 'com.blankj:buildSrc-plugin:1.0' 12 | // } 13 | //} 14 | 15 | //apply plugin: "com.blankj.buildSrc" 16 | 17 | 18 | //dependencyResolutionManagement { 19 | // repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 20 | // repositories { 21 | // google() 22 | // mavenCentral() 23 | // jcenter() // Warning: this repository is going to shut down soon 24 | // maven {url 'https://jetpack.io'} // Warning: this repository is going to shut down soon 25 | // } 26 | // 27 | //// configurations.all { 28 | //// resolutionStrategy.cacheChangingModulesFor 0, 'seconds' 29 | //// 30 | //// resolutionStrategy.eachDependency { 31 | //// if (it.requested.group == 'com.android.support' && !it.requested.name.contains( 32 | //// 'multidex')) { 33 | //// it.useVersion Config.supportVersion 34 | //// } 35 | //// } 36 | //// } 37 | //} 38 | 39 | apply from: 'module_config.gradle' 40 | -------------------------------------------------------------------------------- /sign/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Blankj/AndroidUtilCode/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/sign/keystore.jks -------------------------------------------------------------------------------- /sign/keystore.properties: -------------------------------------------------------------------------------- 1 | keystore=keystore.jks 2 | storePassword=utilcode 3 | keyAlias=utilcode 4 | keyPassword=utilcode --------------------------------------------------------------------------------