vinaygaba /
CreditCardView
💳 CreditCardView is an Android library that allows developers to create the UI which replicates an actual Credit Card.
70/100 healthLoading repository data…
arefbhrn / repository
An Android library, containing a collection of useful custom views
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
An Android library, containing a collection of useful custom views
| View Class Name | Description |
|---|---|
| AspectRatioLayout | A view group with aspect ratio attribute (Its width/height sets by a ratio to its height/width). |
| AutoFitEditText | An EditText which fits text in bounds by changing text size. |
| CustomViewPager | A ViewPager having ability to turn on/off swiping between pages. |
| JustifiedTextView | A TextView that justifies text for both RTL and LTR texts |
| MaskedEditText | A library to achieve masked EditText for both RTL and LTR texts |
| RelativeSizeLayout | A view group which its width and height will be set by a ratio to its parent's width and height separately. |
| RoundedCornerLayout | A container layout that every corner's radius and its background color can be controlled. |
| ShadowLayout | A container layout which drops shadow over its children. |
Gradle
dependencies {
implementation 'com.github.arefbhrn:usefulcustomviews:1.0.1'
}
Define 'app' namespace on root view in your layout
xmlns:app="http://schemas.android.com/apk/res-auto"
Use this library in your layout like this:
<com.arefbhrn.usefulcustomviews.AspectRatioLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:arl_aspect_ratio="0.5"
app:arl_is_ratio_height_to_width="true">
// any other layouts
</com.arefbhrn.usefulcustomviews.AspectRatioLayout>
| XML Attribute | Programmatic Setter | Description |
|---|---|---|
| app:arl_aspect_ratio | setAspectRatio(float ratio) | Aspect ratio (height / width). |
| app:arl_is_ratio_height_to_width | setIsRatioHeightToWidth(boolean isRatioHeightToWidth) | If true: aspect ratio = (height / width), otherwise: aspect ratio = (width / height) |
Use this library in your layout like this:
<com.arefbhrn.usefulcustomviews.CustomViewPager
android:layout_width="match_parent"
android:layout_height="match_parent"
app:swipe_enabled="false" />
| XML Attribute | Programmatic Setter | Description |
|---|---|---|
| app:swipe_enabled | setSwipeEnabled(boolean isSwipeEnabled) | Sets swiping between pages enable/disabled. |
Use this library in your layout like this:
<com.arefbhrn.usefulcustomviews.JustifiedTextView
android:layout_width="match_parent"
android:layout_height="wrap_content" />
Use this library in your layout like this:
<com.arefbhrn.usefulcustomviews.maskededittext.MaskedEditText
android:layout_width="match_parent"
android:layout_height="match_parent"
app:met_mask="(###) ##-### ####"
app:met_allowed_chars="1234567890"
app:met_denied_chars="qwertyuiopasdfghjklzxcvbnm"
app:met_char_representation="#"
app:met_keep_hint="true" />
| XML Attribute | Programmatic Setter | Description |
|---|---|---|
| app:met_mask | - | Sets mask to text. |
| app:met_allowed_chars | - | Sets acceptable characters. |
| app:met_denied_chars | - | Sets unacceptable characters. |
| app:met_char_representation | - | Sets character representation. |
| app:met_keep_hint | - | Sets keeping hint or hiding it on typing. |
| - | getText() | Returns masked text. |
| - | getRawText() | Sets unmasked text. |
Use this library in your layout like this:
<com.arefbhrn.usefulcustomviews.RelativeSizeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:swipe_enabled="false">
// any other layouts
</com.arefbhrn.usefulcustomviews.RelativeSizeLayout>
| XML Attribute | Programmatic Setter | Description |
|---|---|---|
| app:rsl_width_ratio | setWidthRatio(float widthRatio) | Sets width ratio to parent's width. |
| app:rsl_height_ratio | setHeightRatio(float heightRatio) | Sets height ratio to parent's height. |
Use this library in your layout like this:
<com.arefbhrn.usefulcustomviews.RoundedCornerLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:rcl_color="#FF0000"
app:rcl_radius="7dp"
app:rcl_radius_top_left="7dp"
app:rcl_radius_top_right="7dp"
app:rcl_radius_bottom_right="7dp"
app:rcl_radius_bottom_left="7dp">
// any other layouts
</com.arefbhrn.usefulcustomviews.RoundedCornerLayout>
| XML Attribute | Programmatic Setter | Description |
|---|---|---|
| app:rcl_color | setBackgroundColor(int backgroundColor) | Sets rounded background color. |
| app:rcl_radius | setRadius(float radius) | Sets radius on all corners. This overrides other corner radius settings. |
| app:rcl_radius_top_left , app:rcl_radius_top_right , app:rcl_radius_bottom_right , app:rcl_radius_bottom_left | setRadius(float topLeftRadius, float topRightRadius, float bottomRightRadius, float bottomLeftRadius) | Sets radius on each corner. |
Use this library in your layout like this:
<com.arefbhrn.usefulcustomviews.ShadowLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:sl_shadowed="true"
app:sl_shadow_color="#000"
app:sl_shadow_distance="3dp"
app:sl_shadow_angle="90"
app:sl_shadow_radius="3dp">
// any other layouts
</com.arefbhrn.usefulcustomviews.ShadowLayout>
| XML Attribute | Programmatic Setter | Description |
|---|---|---|
| app:sl_shadowed | setIsShadowed(boolean isShadowed) | Sets shadow enabled/disabled. |
| app:sl_shadow_color | setShadowColor(int shadowColor) | Sets shadow color. |
| app:sl_shadow_distance | setShadowDistance(float shadowDistance) | Sets shadow distance. |
| app:sl_shadow_angle | setShadowAngle(float shadowAngle) | Sets shadow drop angle. |
| app:sl_shadow_radius | setShadowRadius(float shadowRadius) | Sets shadow radius. |
Same as ShadowLayout but only can be usable in scroll views which ShadowLayout won't work.
If you have a better idea or way on this project, please let me know, thanks :)
This project is licensed under the Apache 2.0 License - see the LICENSE.md file for details
Selected from shared topics, language and repository description—not editorial ratings.
vinaygaba /
💳 CreditCardView is an Android library that allows developers to create the UI which replicates an actual Credit Card.
70/100 healthrazaghimahdi /
A library which allows you to have some beautiful loading with dots, for both Java and Kotlin in XML
65/100 healthJumman04 /
Analog Clock Library is a customizable Android library that displays time in a traditional analog format. Easily integrate a stylish analog clock into your app with adjustable colors, markers, hand styles, ticking sound effects, and more.
69/100 healthdarshan-miskin /
A Customizable PinView library for Android which supports 'Paste' via clipboard, flawlessly! Originally written in Java & XML, has been migrated to Kotlin & Compose. Yet backward compatible to Java & XML.
72/100 healthEdwardwmd /
This is a Demo library about Android custom controls, which implements a variety of custom controls
40/100 healthMrMindyMind /
Android Library for custom Views with animations
40/100 health