Nasa Circle Image View is a lightweight (~7.69 KB) and efficient library similar to the popular CircleImageView library. It provides a simple way to create circular image views with customizable borders.
Follow the steps below to integrate Nasa Circle Image View into your Android project.
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
// other repositories
maven { url 'https://jitpack.io' } // add JitPack repository
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
// other repositories
maven(url = "https://jitpack.io") // add JitPack repository
}
}
dependencies {
implementation 'com.github.CodeWithTamim:NasaCircleImageView:1.0.5'
}
dependencies {
implementation("com.github.CodeWithTamim:NasaCircleImageView:1.0.5")
}
If your minimum SDK version is not 21 or differs, add the following to your AndroidManifest.xml
:
<uses-sdk android:minSdkVersion="your_min_sdk" tools:overrideLibrary="com.nasahacker.downloader" />
You can add the circle image view to your XML layout like this:
<com.nasahacker.library.NasaCircleImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@color/white"/>
You can customize the border color and width using XML attributes or programmatically.
app:borderColor="#ECEC"
app:borderWidth="10dp"
// Set border color using a direct color value
circleImageView.setBorderColor(Color.RED);
// Set border color using a color resource ID
circleImageView.setBorderColorResource(R.color.border_color);
// Set border width
circleImageView.setBorderWidth(10f); // 10f for 10 pixels
// Set border color using a direct color value
circleImageView.setBorderColor(Color.RED)
// Set border color using a color resource ID
circleImageView.setBorderColorResource(R.color.border_color)
// Set border width
circleImageView.setBorderWidth(10f) // 10f for 10 pixels
If Nasa Circle Image View helped you, consider giving it a ⭐️ and sharing it with fellow developers. Contributions are welcome! Feel free to fork the project, make your changes, and submit a pull request.
This project is licensed under the Apache License 2.0. See the LICENSE file for more details.
Thank you for using Nasa Circle Image View! I’m Tamim, the creator of this library. If you have any questions or need further assistance, feel free to open an issue or email me.