Posts

Showing posts from August, 2021

Shapeable ImageView | Android Studio | Java

Image
ShapeableImageView The ShapeableImageView is an ImageView that draws the bitmap with the provided Shape. For example, in your app, you may need an app with the shape of Circle, Rectangle, Rounded corners, Stroke/Border, etc. Using the ShapeableImageView you can easily draw images with any shape. >>Check For Kotlin Video Tutorial Code: styles.xml <?xml version="1.0" encoding="utf-8"?> <resources> <!--Adding styles to make different shapes for shapeable image view--> <style name= "ImageStyle_Circle" > <item name= "cornerSize" > 50% </item> <item name= "cornerFamily" > rounded </item> <!--possible values are rounded, cut--> </style> <style name= "ImageStyle_Corners_Rounded" > <item name= "cornerSize" > 20dp </item> <item name= "cornerFamily" > rounded <

Shapeable ImageView | Android Studio | Kotlin

Image
ShapeableImageView The ShapeableImageView is an ImageView that draws the bitmap with the provided Shape. For example, in your app, you may need an app with the shape of Circle, Rectangle, Rounded corners, Stroke/Border, etc. Using the ShapeableImageView you can easily draw images with any shape. >>Check For Java Video Tutorial Code: styles.xml <?xml version="1.0" encoding="utf-8"?> <resources> <!--Adding styles to make different shapes for shapeable image view--> <style name= "ImageStyle_Circle" > <item name= "cornerSize" > 50% </item> <item name= "cornerFamily" > rounded </item> <!--possible values are rounded, cut--> </style> <style name= "ImageStyle_Corners_Rounded" > <item name= "cornerSize" > 20dp </item> <item name= "cornerFamily" > rounded </i

startActivityForResult Depreciated Solution | Android Studio | Kotlin

Image
How to use ActivityResult OR ActivityResultLauncher? Since the  startActivityForResult()  used to launce the intents like  Gallery ,  Camera ,  File Pick ,  Share data , etc is deprecated so now there is a new way to do that  ActivityResultLauncher  class.  >>Check for Java Video Tutorial: Code: activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http://schemas.android.com/apk/res-auto" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "match_parent" android:layout_height= "match_parent" android:orientation= "vertical" android:gravity= "center" tools:context= ".MainActivity" > <!--ImageView: Set image after picking from gallery--> <ImageView android:id= "@+id/profileIv" android

startActivityForResult Depreciated Solution | Android Studio | Java

Image
How to use ActivityResult OR ActivityResultLauncher? Since the startActivityForResult() used to launce the intents like Gallery , Camera , File Pick , Share data , etc is deprecated so now there is a new way to do that ActivityResultLauncher class.  >>Check for Kotlin Video Tutorial: Code: activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http://schemas.android.com/apk/res-auto" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "match_parent" android:layout_height= "match_parent" android:orientation= "vertical" android:gravity= "center" tools:context= ".MainActivity" > <!--ImageView: set image after picking from gallery--> <ImageView android:id= "@+id/profileIv" android:lay