Skip to content

Extensions to the Android standard library and support libraries and some basic tools

Notifications You must be signed in to change notification settings

asker517/androidx

Repository files navigation

ANDROIDX

Platform Platform API License

Extensions to the Android standard library and support libraries and some basic tools

⚠️ Warning

Currently in the development stage, some APIs have not been tested yet, please use them carefully

Child module

Getting Started

Add the following to your build.gradle file

implementation "me.panpf:androidx:$lastVersion"

Please replace $lastVersion with the latest version: Download

Dependencies:

Kotlin Expansion:

Add the following to your build.gradle file

implementation "me.panpf:androidx-kt:$lastVersion"

Please replace $lastVersion with the latest version: Download

Dependencies:

androidx-kt is a androidx extension on the Kotlin platform that allows you to use androidx more comfortably on Kotlin

Index

⚠️ Representatives with the (Test) tag have passed the test and can be used with confidence.

android

  • Android: Androidx.java (Test) | Androidx.kt (Test)
    • getMainHandler, runInUI, waitRunInUI, waitRunInUIResult, waitRunInUINullableResult, isRooted, isMainThread,
    • getInProcessName, getInProcessNameSuffix, isMainProcess, isAtLeast*, getVersionName, getVersionCodeName

app

  • 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

content

  • 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

graphics

  • 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

  • Hardware: Hardwarex.java (Test) | Hardwarex.kt (Test)
    • getProduct, getBrand, getModel, getDevice, getHardware, getSupportedAbis, getPhoneNumber, getDeviceId,
    • getAndroidId, getSubscriberId, getSimSerialNumber, getSerial, getIMEI, getIMSI, getMacAddress

net

  • 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

os

  • 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

provider

  • Settings: Settingsx.java | Settingsx.kt
    • isScreenBrightnessModeAutomatic, setScreenBrightnessModeAutomatic, getScreenBrightness,
    • setScreenBrightness, getWindowBrightness, setWindowBrightness, isWindowBrightnessFlowSystem,
    • getScreenOffTimeout, setScreenOffTimeout, isAirplaneModeOn, setAirplaneModeOn, isBluetoothOn,
    • setBluetoothOn, getMediaVolume, setMediaVolume, getRingVolume, setRingVolume

util

view

  • 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

widget

Change Log

Please view the CHANGELOG.md file

License

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.

About

Extensions to the Android standard library and support libraries and some basic tools

Resources

Stars

Watchers

Forks

Packages

No packages published