A repository for all extensions which I use on a daily basis, this repo is to help developers in building apps much faster by providing frequently used code snippets in one place Feel Free to contribute
kotlin version => 2.0.0
What's inside:
Bitmap Extensions: BitmapX.kt
- Save a Bitmap to File
- Save a Bitmap to File Path
- Get Bitmap of a View
- Get ScreenShot of a view with callback
- Save a View to a file as an Image
- Get Bitmap from URI
- Get dominating color in a Bitmap
- Rotate a Bitmap by it's orientation based on Exif Data
- Scale a Bitmap while preserving it's aspect ratio
- Copy a file using it's URI
- Copy a File to another location by using File object from Java IO
- Convert a vector xml file to bitmap
CameraX Extensions: CameraX.kt
- Initialize CameraController using given PreviewView to show Camera Feed
- Initialize CameraController and PreviewView and return them as callback for compose
- Initalize CameraController using provided PreviewView to Show Camera Feed for Compose
- Get Camera Provider from context
- Create ImageCapture UseCase
- Create VideoCapture UseCase
Context Extensions: ContextX.kt
- Hide soft keyboard
- Get Theme Color Using attr name
- Get Resource URI of any res id
- Get Res ID from it's name - not recommended to use
- Get Drawable ID from it's name - not recommended to use
- Get App Icon of any other installed app - requires little setUp
- Get LayoutInflator form Context
- Get InputMethodManager form context
- Get Drawable from ID
- Get Color Compat from ID
Other Extensions: Extensions.kt
- Format an Int vale to USD like 1000000 to 1,000,000
- Format an Int value to INR like 1000000 to 10,00,000
- Check if a PDF is Password Protected
- Convert Int to DP or PX
- Convert Dp to Px
- Get ScreenHeight or ScreenWidth of the Device
- Copy a String to Clipboard
- Perform basic touch at a point with x,y as coordinates
- Share a String