Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nikartx/image-support

Add badge with counter to ImageView Android.
https://github.com/nikartx/image-support

android android-development android-library android-ui badge badge-count counter custom-view icon imageview

Last synced: 2 days ago
JSON representation

Add badge with counter to ImageView Android.

Awesome Lists containing this project

README

        

[![Maven Central](https://img.shields.io/maven-central/v/io.github.nikartm/image-support.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.nikartm%22%20AND%20a:%22image-support%22) [![Android Arsenal]( https://img.shields.io/badge/Android%20Arsenal-ImageBadgeView-green.svg?style=flat )]( https://android-arsenal.com/details/1/7619)

# ImageBadgeView
Library to add ImageView (ImageBadgeView) with a badge like notification count.
## Download
Add to gradle root:
```
allprojects {
repositories {
mavenCentral()
}
}
```

#### After migrating to MavenCentral, use Groove:
```
implementation 'io.github.nikartm:image-support:2.0.0'
```
Or Kotlin DSL:
```
implementation("io.github.nikartm:image-support:2.0.0")
```
Or take a different [approach](https://search.maven.org/artifact/io.github.nikartm/image-support/2.0.0/aar)

Old way (deprecated):
```
implementation 'com.github.nikartm:image-support:$LAST_VERSION'
```

## Screenshots
![BarcodeInfo Screenshots](https://raw.githubusercontent.com/nikartm/Image-Support/master/screenshots/sct_1.png)
## How to use?
Adjust the xml view [More examples.](https://github.com/nikartm/Image-Support/blob/master/app/src/main/res/layout/activity_main.xml):
```

```
Or programmatically:
```
imageBadgeView.setBadgeValue(27)
.setBadgeOvalAfterFirst(true)
.setBadgeTextSize(16)
.setMaxBadgeValue(999)
.setBadgeTextFont(typeface)
.setBadgeBackground(getResources().getDrawable(R.drawable.rectangle_rounded))
.setBadgePosition(BadgePosition.BOTTOM_RIGHT)
.setBadgeTextStyle(Typeface.NORMAL)
.setShowCounter(true)
.setBadgePadding(4);
```
Change the position of a badge on view:
```
app:ibv_badgePosition="bottom_right"
```
Use the custom badge background:
```
app:ibv_badgeBackground="@drawable/rectangle_rounded"
```
Example the custom background - rectangle_rounded.xml:
```


```

## License
Copyright 2018 Ivan Vodyasov

Licensed 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 at

http://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.