Extensions to the Android standard library and support libraries and some basic tools
- androidx-kt-arch: Kotlin extension to Android Architecture related libraries
- Google Nexus 4;API 25/7.1.2;LineageOS/14.1-20180427-NIGHTLY-make
- Lenovo K860;API 17/4.2.1
Add the following to your build.gradle
file
implementation "me.panpf:androidx:$lastVersion"
Please replace $lastVersion
with the latest version:
Dependencies:
- androidx.fragment:fragment: 1.2.0-alpha01
- me.panpf:javax: 1.0.0-alpha04
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.3.21
- androidx.fragment:fragment: 1.1.0
- me.panpf:javax-kt: 1.0.0-alpha04
androidx-kt is a androidx extension on the Kotlin platform that allows you to use androidx more comfortably on Kotlin
- 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, getImplFromParent
- appContext, canStart, start, startByClass, safeStart, safeStartByClass
- Args: Argsx.java (Test) | Argsx.kt (Test)
- read*Arg, read*ArgOr, read*UriArg, read*UriArgOr, read*IntentUriArg, read*IntentUriArgOr,
- read*UriIntentArg, read*UriIntentArgOr
- ArgsBinder: ArgsBinder.kt (Test)
- bind*Arg, bind*ArgOr, bind*UriArg, bind*UriArgOr, bind*IntentUriArg, bind*IntentUriArgOr,
- bind*UriIntentArg, bind*UriIntentArgOr
- Dialog: Dialogx.java (Test) | Dialogx.kt (Test)
- setClickButtonClosable, showProgressDialog
- Fragment: Fragmentx.java (Test) | Fragmentx.kt (Test)
- getApplication, requireApplication, isDestroyedCompat, getImplFromParent, instantiate,
- findUserVisibleChildFragment, findFragmentByViewPagerCurrentItem
- Permission: Permissionx.java (Test) | Permissionx.kt (Test)
- isGrantPermissions, filterDeniedPermissions
- Service: Servicex.java (Test) | Servicex.kt (Test)
- isRunning, start, stop, isAccessibilityServiceEnabled
- PackageInfo: PackageInfox.java (Test) | PackageInfox.kt (Test)
- findActivityInfo, findActivityInfoByName, findServiceInfo, findServiceInfoByName
- findReceiverInfo, findReceiverInfoByName, findProviderInfo, findProviderInfoByName
- findPermissionInfo, findPermissionInfoByName, findRequestedPermission, findRequestedPermissionByName
- findMetaDataWithName, findMetaDataByName, findMetaDataWithValue, findMetaDataByValue
- Package: Packagex.java (Test) | Packagex.kt (Test)
- requestInstall, requestUninstallisInstalled, getVersionCode, getVersionCodeOr, getVersionName, getVersionNameOr,
- getVersionNameOrNull, get, getOrNull, isSystemApp, isSystemAppOr, listPackageVersionCodePair,
- getPackageVersionCodeMap, listPackageName, list, getOne, count, getPackageApkFile,
- getPackageApkFileOrNull, getAppSignatureBytes, getAppSignatureBytesOrNull,
- getAppIconDrawable, getAppIconBitmap, getApkIconDrawable, getApkIconBitmap
- 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
- Context: Contextx.java (Test) | Contextx.kt (Test)
- requireContext, requireAppContext, appContext, systemService, systemServiceOrNull, *Manager
- Intent: Intentx.java (Test) | Intentx.kt (Test)
- createRecordingIntent, createLaunchDialingIntent, createCallPhoneIntent, createLaunchSendSmsIntent,
- createLaunchWebBrowserIntent, createScanFileBroadcastIntent, createInstallAppIntent, createUninstallAppIntent,
- createLaunchAppIntent, createAppDetailInSystemIntent, createActivityIntentByResolveInfo, createTakePhotoIntent,
- createPickImageIntent, createCropImageIntent, createSendTextIntent, createSendTextFileIntent,
- createSendImageFileIntent, createSendFileIntent, getShareFileUri
- LifecycleBroadcastReceiver: LifecycleBroadcastReceiver.java (Test)
- Preference: Preferencex.java (Test) | Preferencex.kt (Test)
- getPreferences, getDefaultPreferences, putIntTo, putInt, putIntsTo, putInts, putLongTo, putLong, putLongsTo, putLongs,
- putBooleanTo, putBoolean, putBooleansTo, putBooleans, putFloatTo, putFloat, putFloatsTo, putFloats,
- putStringTo, putString, putStringsTo, putStrings, putStringSetTo, putStringSet, putStringSetsTo, putStringSets,
- getIntFrom, getInt, getLongFrom, getLong, getBooleanFrom, getBoolean, getFloatFrom, getFloat,
- getStringFrom, getStringOrNullFrom, getString, getStringOrNull, getStringSetFrom, getStringSetOrNullFrom,
- getStringSet, getStringSetOrNull, getAllFrom, getAll, removeFrom, remove, contains, containsAny, containsAll,
- containsFrom, containsAnyFrom, containsAllFrom, isEmpty, isEmptyFrom, clear,
- registerOnChangeListener, registerOnChangeListenerTo, unregisterOnChangeListener, unregisterOnChangeListenerFrom
- Drawable: Drawablex.java (Test) | Drawablex.kt (Test)
- toBitmapWithIntrinsicSize, toBitmapWithBoundsSize, changeColor, changeResDrawableColor
- Bitmap: Bitmapx.java (Test) | Bitmapx.kt (Test)
- crop, cropTo, centerCrop, centerCropTo, circular, circularTo, tint, createByColor, toByteArray,
- writeToFile, readBitmap, toDrawable, use, calculateSamplingSize, calculateSamplingSizeForRegion
- Image: Imagex.java (Test) | Imagex.kt (Test)
- 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 (Test) | Matrixx.kt (Test)
- getValue, getScale
- OpenGl: OpenGlx.java (Test) | OpenGlx.kt Matrixx.kt (Test)
- getVersion, getMaxTextureSize,
- Paint: Paintx.java (Test) | Paintx.kt (Test)
- getTextWidth, getTextHeight, getTextWidthByBounds, getTextHeightByBounds, getTextLeading
- Resize: Resizex.java (Test)
- srcMappingStartRect, srcMappingCenterRect, srcMappingEndRect, srcMatrixRect,
- scaleTargetSize, calculator
- 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 (Test)
- isActivated, isWifiActivated, isNoMeteredWifiActivated, isMobileActivated, isBluetoothActivated,
- getType, isVPNActivated, isMetered, isRoaming, isFailover, getTypeName, getSubtypeName,
- getExtraInfo, getNetworkInfo, getConnectivity
- Network: Networkx.java (Test) | Networkx.kt (Test)
- 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)
- getFreeBytesOr, getTotalBytesOr, getAvailableBytesOr, 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][StorageManagerCompatTest.kt])
- getVolumeList, getVolumes, getVolumePaths, getVolumeState, getVolume
- StorageVolumeCompat: StorageVolumeCompat.java (Test) | [StorageVolumeCompat.kt] ([Test][StorageVolumeCompatTest.kt])
- getPath, getPathFile, isPrimary, isRemovable, isEmulated, getState, allowMassStorage, getMaxFileSize,
- BundleBuilder: BundleBuilder.java (Test)
- Rom: Romx.java (Test)
- getType, isType, isMiuiType, isEmuiType, isFlymeType, isColorType, isFuntouchOSType, isSmartisanOSType,
- isH2OSType, getTypeName, getVersionName, getVersionCode, getVersionIncremental
- SystemProperties: SystemPropertiesx.java (Test)
- get, getOr, getIntOr, getLongOr, getBooleanOr, set, addChangeCallbacks, callChangeCallbacks
- Settings: Settingsx.java (Test) | Settingsx.kt (Test)
- isScreenBrightnessModeAutomatic, setScreenBrightnessModeAutomatic, getScreenBrightness,
- setScreenBrightness, getScreenOffTimeout, setScreenOffTimeout, isAirplaneModeOn, setAirplaneModeOn,
- isBluetoothOn, setBluetoothOn, getMediaVolume, setMediaVolume, getRingVolume, setRingVolume
- Dimen: Dimenx.java (Test) | Dimenx.kt (Test)
- dp2px, px2dp, sp2px, px2sp, applyDimension
- Text: Textx.java (Test) | Textx.kt (Test)
- textToBitmap, changeColorByHtml, changeColorToRedByHtml, changeKeywordColorByHtml, changeKeywordColorToRedByHtml,
- changeColorBySpannable, changeColorToRedBySpannable, changeKeywordColorBySpannable, changeKeywordColorToRedBySpannable
- WeakAsyncTask: WeakAsyncTask.java (Test)
- SingletonLazy: SingletonLazy.java (Test)
- InputMethod: InputMethodx.java (Test) | InputMethodx.kt (Test)
- showSoftInput, delayShowSoftInput, hideSoftInput, moveCursorToEnd, moveCursorToStart, moveCursorTo
- Display: Displayx.java (Test) | Displayx.kt (Test)
- getScreenSize, getScreenWidth, getScreenHeight, getActionBarSize, getMetrics, getDensity, getDisplayRotation
- getDensityDpi, isOrientationPortrait, isOrientationLandscape, isOrientationUndefined, getRotation
- hasNavigationBar, getStatusBarHeight, getNavigationBarHeight, getNavigationBarWidth
- ViewAnim: ViewAnimx.java (Test) | ViewAnimx.kt (Test)
- animAlpha, animTranslate, shake, shock, startAnimFromRes, invisibleByAnimAlpha,
- goneByAnimAlpha, visibleByAnimAlpha,
- View: Viewx.java (Test) | Viewx.kt (Test)
- setLongClickToastHint, setLayoutWidth, setLayoutHeight, setLayoutSize, setLayoutMarginTop,
- addLayoutHeight, addLayoutWidth, addLayoutSize, addLayoutMarginTop, toBitmap, toBitmapByMaxWidth,
- toBitmapByMaxHeight, inflateLayout, addPaddingTopByStatusBarHeight
- Window: Windowx.java (Test) | Windowx.kt (Test)
- getBrightness, setBrightness, isBrightnessFlowSystem
- 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.