Extensions to the Android standard library and support libraries and some basic tools
Currently in the development stage, some APIs have not been tested yet, please use them carefully
- androidx-kt-arch: Kotlin extension to Android Architecture related libraries
Add the following to your build.gradle
file
implementation "me.panpf:androidx:$lastVersion"
Please replace $lastVersion
with the latest version:
Dependencies:
Add the following to your build.gradle
file
implementation "me.panpf:androidx-kt:$lastVersion"
Please replace $lastVersion
with the latest version:
Dependencies:
- org.jetbrains.kotlin:kotlin-stdlib-jdk7: 1.2.71
- com.android.support:support-fragment: 28.0.0
- me.panpf:javax-kt: 0.8.5
androidx-kt is a androidx extension on the Kotlin platform that allows you to use androidx more comfortably on Kotlin
(Test)
tag have passed the test and can be used with confidence.
- Android: Androidx.java (Test) | Androidx.kt (Test)
- getMainHandler, runInUI, waitRunInUI, waitRunInUIResult, waitRunInUINullableResult, isRooted, isMainThread,
- getInProcessName, getInProcessNameSuffix, isMainProcess, isAtLeast*, getVersionName, getVersionCodeName
- Activity: Activityx.java (Test) | Activityx.kt (Test)
- isDestroyedCompat, convertToTranslucentCompat, convertFromTranslucentCompat, getImplWithParent
- appContext, canStart, start, safeStart
- Args: Argsx.java | Argsx.kt
- read*Arg, read*ArgOr, read*UriArg, read*UriArgOr, read*IntentUriArg, read*IntentUriArgOr,
- read*UriIntentArg, read*UriIntentArgOr
- ArgsBinder: ArgsBinder.kt
- bind*Arg, bind*ArgOr, bind*UriArg, bind*UriArgOr, bind*IntentUriArg, bind*IntentUriArgOr,
- bind*UriIntentArg, bind*UriIntentArgOr
- Dialog: Dialogx.java | Dialogx.kt
- setClickButtonClosable, showProgressDialog
- Fragment: Fragmentx.java | Fragmentx.kt
- isDestroyedCompat, getImplWithParent, instance, findUserVisibleChildFragment, findFragmentByViewPagerCurrentItem
- requireContext, requireAppContent, read*Arg
- Permission: Permissionx.java (Test) | Permissionx.kt (Test)
- isGrantPermissions, filterDeniedPermissions
- Service: Servicex.java | Servicex.kt
- isRunning, start, tryStart, stop, tryStop
- Package: Packagex.java | Packagex.kt
- isInstalled, getVersionCode, getVersionName, getPackage, isSystemApp, getAllAppIdAndVersionCodeMap,
- getAllAppIdAndVersionCodeSet, getAllAppId, getAllApp, getOne, count, getAppPackageFile,
- getAppSignatureBytes, getAppIconDrawable, getAppIconBitmap, getApkIconDrawable, getApkIconBitmap
- Asset: Assetx.java | Assetx.kt
- openInput, readBytes, readText, readLines, readBitmap
- Clipboard: Clipboardx.java (Test) | Clipboardx.kt (Test)
- copy, copyText, copyHtmlText, copyIntent, copyUri, copyRawUri, copyMimeTypeUri, copyContents,
- get, getLabel, getContents, getText, getHtmlText, getIntent, getUri, addPrimaryClipChangedListener,
- removePrimaryClipChangedListener, clear
- Content: Contentx.java | Contentx.kt
- openInput, readBytes, readText, readLines, readBitmap
- Context: Contextx.java (Test) | Contextx.kt (Test)
- systemService, systemServiceOrNull, *Manager
- Intent: Intentx.java | Intentx.kt
- createRecordingIntent, createLaunchDialingIntent, createCallPhoneIntent, createLaunchSendSmsIntent,
- createLaunchWebBrowserIntent, createScanFileBroadcastIntent, createInstallAppIntent, createUninstallAppIntent,
- createLaunchAppIntent, createAppDetailInSystemIntent, createActivityIntentByResolveInfo, createTakePhotoIntent,
- createPickImageIntent, createCropImageIntent, createSendTextIntent, createSendTextFileIntent,
- createSendImageFileIntent, createSendFileIntent
- Preference: Preferencex.java | Preferencex.kt
- getPreference, putInt, putLong, putBoolean, putFloat, putString, putStringSet,
- getInt, getLong,getBoolean, getFloat, getString, getStringSet, getAll, remove, clear
- Drawable: Drawablex.java (Test) | Drawablex.kt (Test)
- toBitmapWithIntrinsicSize, toBitmapWithBoundsSize, toDrawableByColor, toDrawableByColorFromDrawableRes
- Bitmap: Bitmapx.java | Bitmapx.kt
- centerCrop, centerCropTo, circular, circularTo, tint, createByColor, toByteArray,
- writeToFile, readBitmap, toDrawableByColor, use, calculateSamplingSize, calculateSamplingSizeForRegion
- Image: Imagex.java | Imagex.kt
- getMimeType, getMimeSubType
- Color: Colorx.java (Test) | Colorx.kt (Test)
- WHITE/BLACK/RED..., getAlpha, setAlpha, addAlpha, getHSVHue, setHSVHue, getHSVSaturation,
- setHSVSaturation, addHSVSaturation, getHSVValue, setHSVValue, addHSVValue, isLight,
- createMatrixColorFilter, argbEvaluate
- Matrix: Matrixx.java | Matrixx.kt
- getValue, getScale
- OpenGl: OpenGlx.java | OpenGlx.kt
- getVersion, getMaxTextureSize,
- Paint: Paintx.java | Paintx.kt
- getTextWidth, getTextHeight, getTextWidthByBounds, getTextHeightByBounds, getTextLeading
- Hardware: Hardwarex.java (Test) | Hardwarex.kt (Test)
- getProduct, getBrand, getModel, getDevice, getHardware, getSupportedAbis, getPhoneNumber, getDeviceId,
- getAndroidId, getSubscriberId, getSimSerialNumber, getSerial, getIMEI, getIMSI, getMacAddress
- NetworkState: NetworkState.java | NetworkState.kt
- isActivated, isWifiActivated, isNoMeteredWifiActivated, isMobileActivated, isBluetoothActivated,
- getType, isVPNActivated, isMetered, isRoaming, isFailover, getTypeName, getSubtypeName,
- getExtraInfo, getNetworkInfo, getConnectivity
- Network: Networkx.java | Networkx.kt
- getState, isActivated, isWifiActivated, isNoMeteredWifiActivated, isMobileActivated,
- isBluetoothActivated, getType, isVPNActivated, isMetered, isRoaming, isFailover, getTypeName,
- getSubtypeName, getExtraInfo, getNetworkInfo, getConnectivity, getWifiState,
- isWifiEnabled, setWifiEnabled, isMobileEnabled, setMobileEnabled, getGateway, getDNS1, getDNS2
- Storage: Storagex.java (Test) | Storagex.kt (Test)
- getFreeBytes, getTotalBytes, getAvailableBytes, getVolumeState, isVolumeMounted, isPrimaryVolume,
- isVolumeEmulated, isVolumeRemovable, getVolumePaths, getMountedVolumePaths, getVolumeFiles,
- getMountedVolumeFiles, getVolumeList, getMountedVolumeList, getVolumes, getMountedVolumes, getVolume,
- getExternalStorageState, isExternalStorageMounted, isPrimaryExternalStorage, isExternalStorageEmulated,
- isExternalStorageEmulated, isExternalStorageRemovable, isExternalStorageRemovable,
- getExternalStorageDirectory, getMountedExternalStorageDirectory, getExternalStorageDirectorys,
- getMountedExternalStorageDirectorys, getExternalStorageDirectorys, getMountedExternalStorageDirectorys,
- getExternalStorageDirectorysWithPath, getMountedExternalStorageDirectorysWithPath,
- getAppExternalCacheDir, getAppExternalCacheDirs, getAppInternalCacheDir, getAppCacheDirs,
- lengthAppCacheDirs, cleanAppCacheDirs, getAppExternalFilesDir, getAppExternalFilesDirs,
- getAppInternalFilesDir, getAppFilesDirs, lengthAppFilesDirs, cleanAppFilesDirs,
- getAppObbDir, getAppObbDirs, lengthAppObbDirs, cleanAppObbDirs, filterByMinBytes, getFileIn
- StatFs: StatFsx.java (Test) | StatFsx.kt (Test)
- getCompatAvailableBytes, getCompatFreeBytes, getCompatTotalBytes
- StorageManagerCompat: StorageManagerCompat.java (Test) | StorageManagerCompat.kt (Test)
- getVolumeList, getVolumes, getVolumePaths, getVolumeState, getVolume
- StorageVolumeCompat: StorageVolumeCompat.java (Test) | StorageVolumeCompat.kt (Test)
- getPath, getPathFile, isPrimary, isRemovable, isEmulated, getState, allowMassStorage, getMaxFileSize,
- Rom: Romx.java (Test)
- getType, isType, isMiuiType, isEmuiType, isFlymeType, isColorType, isFuntouchOSType, isSmartisanOSType,
- isH2OSType, getTypeName, getVersionName, getVersionCode, getVersionIncremental
- SystemProperties: SystemPropertiesx.java (Test)
- get, getInt, getLong, getBoolean, set, addChangeCallbacks, callChangeCallbacks
- Settings: Settingsx.java | Settingsx.kt
- isScreenBrightnessModeAutomatic, setScreenBrightnessModeAutomatic, getScreenBrightness,
- setScreenBrightness, getWindowBrightness, setWindowBrightness, isWindowBrightnessFlowSystem,
- getScreenOffTimeout, setScreenOffTimeout, isAirplaneModeOn, setAirplaneModeOn, isBluetoothOn,
- setBluetoothOn, getMediaVolume, setMediaVolume, getRingVolume, setRingVolume
- Dimen: Dimenx.java | Dimenx.kt
- dp2px, px2dp, sp2px, px2sp, unit2px
- Json: Jsonx.java | Jsonx.kt
- isEmpty, isNotEmpty, toJsonArray, toJson, toStringList, toStringArray, toIntArray,
- toBeanList, toBean, optString, optInt, optLong, format
- Text: Textx.java | Textx.kt
- textToBitmap, toHtmlColorFlag, toHtmlRedFlag, keywordMadeColorByHtml, keywordMadeRedByHtml,
- keywordMadeColorBySpannable, keywordMadeRedBySpannable
- WeakAsyncTask: WeakAsyncTask.java (Test) | WeakAsyncTask.kt (Test)
- InputMethod: InputMethodx.java | InputMethodx.kt
- showSoftInput, delayShowSoftInput, hideSoftInput, moveCursorToEnd, moveCursorToStart, moveCursorTo
- Display: Displayx.java | Displayx.kt
- getScreenSize, getScreenWidth, getScreenHeight, getMetrics, getDensity, getDisplayRotation
- getDensityDpi, isOrientationPortrait, isOrientationLandscape, isOrientationUndefined, getRotation
- hasNavigationBar, getStatusBarHeight, getNavigationBarHeight, getNavigationBarWidth
- ViewAnim: ViewAnimx.java | ViewAnimx.kt
- animAlpha, animTranslate, shake, shock, startAnimFromRes, invisibleByAnimAlpha,
- goneByAnimAlpha, visibleByAnimAlpha,
- View: Viewx.java | Viewx.kt
- setLongClickToastHint, setLayoutWidth, setLayoutHeight, setLayoutSize, setLayoutMarginTop,
- addLayoutHeight, addLayoutWidth, addLayoutSize, addLayoutMarginTop, toBitmap, toBitmapByMaxWidth,
- toBitmapByMaxHeight, inflateLayout, appContext
- Toast: Toastx.java (Test) | Toastx.kt (Test)
- showLong, showShort, showLongWithView, showShortWithView
Please view the CHANGELOG.md file
Copyright (C) 2018 Peng fei Pan <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.