Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nikartx/fitbutton
The button which can use with icon, text, divider, custom ripple effect, border, corner radius e.t.c.
https://github.com/nikartx/fitbutton
android android-button android-development android-library android-ui button button-widget custom-button design java kotlin kotlin-android nikart ripple-effect ui
Last synced: 3 months ago
JSON representation
The button which can use with icon, text, divider, custom ripple effect, border, corner radius e.t.c.
- Host: GitHub
- URL: https://github.com/nikartx/fitbutton
- Owner: nikartx
- Created: 2019-03-25T08:53:55.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-07-09T10:50:51.000Z (over 3 years ago)
- Last Synced: 2024-10-13T04:21:41.505Z (3 months ago)
- Topics: android, android-button, android-development, android-library, android-ui, button, button-widget, custom-button, design, java, kotlin, kotlin-android, nikart, ripple-effect, ui
- Language: Kotlin
- Homepage:
- Size: 2.99 MB
- Stars: 78
- Watchers: 7
- Forks: 20
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Maven Central](https://img.shields.io/maven-central/v/io.github.nikartm/fit-button.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.nikartm%22%20AND%20a:%22fit-button%22) [![API](https://img.shields.io/badge/API-17%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=17) [![Android Arsenal]( https://img.shields.io/badge/Android%20Arsenal-FitButton-green.svg?style=flat )]( https://android-arsenal.com/details/1/7620 )
# FitButton
The button which includes features:
* Icon,
* Text,
* Divider,
* Corner radius,
* Border of the button,
* Custom ripple effect,
* Custom elements sizes,
* Custom colors of elements,
* Different positions of elements on the button## Installation
#### Download
Add to gradle root:
```
allprojects {
repositories {
mavenCentral()
}
}
```#### After migrating to MavenCentral, use Groove:
```
implementation 'io.github.nikartm:fit-button:2.0.0'
```
Or Kotlin DSL:
```
implementation("io.github.nikartm:fit-button:2.0.0")
```
Or take a different [approach](https://search.maven.org/artifact/io.github.nikartm/fit-button/2.0.0/aar)Old way (deprecated):
```
implementation 'com.github.nikartm:fit-button:$LAST_VERSION'
```## Screenshots
![FitButton Screenshots](/screenshots/img_gif.gif)![FitButton Screenshots](/screenshots/img_1.png) ![FitButton Screenshots](/screenshots/img_2.png) ![FitButton Screenshots](/screenshots/img_3.png)
## How to use?
Adjust the XML view:[More examples](https://github.com/nikartm/FitButton/tree/master/app/src/main/res/layout)
``````
Or programmatically:
```
private fun setupButton() {
fitButton = findViewById(R.id.fbtn)
fitButton!!
.setTextFont(R.font.share_tech_regular)
.setWidth(250)
.setHeight(70)
.setTextSize(20f)
.setIconMarginStart(16f)
.setIconMarginEnd(12f)
.setTextColor(Color.parseColor("#F5F5F5"))
.setIconColor(Color.parseColor("#FFFFFF"))
.setDividerColor(Color.parseColor("#BCAAA4"))
.setBorderColor(Color.parseColor("#FFF59D"))
.setButtonColor(Color.parseColor("#FF7043"))
.setBorderWidth(2f)
.setRippleEnable(true)
.setRippleColor(resources.getColor(R.color.colorAccent))
.setOnClickListener {
Toast.makeText(this,
"Click on ${fitButton?.getText()}",
Toast.LENGTH_SHORT).show()
}
}
```## License
Copyright 2019 Ivan VodyasovLicensed 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 athttp://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.