Coder Social home page Coder Social logo

image-support's Introduction

Maven Central Android Arsenal

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

Old way (deprecated):

implementation 'com.github.nikartm:image-support:$LAST_VERSION'

Screenshots

BarcodeInfo Screenshots

How to use?

Adjust the xml view More examples.:

<ru.nikartm.support.ImageBadgeView
    android:id="@+id/ibv_icon2"
    android:layout_width="80dp"
    android:layout_height="80dp"
    android:layout_marginTop="30dp"
    android:layout_gravity="center"
    android:padding="10dp"
    app:ibv_badgeValue="100"
    app:ibv_badgeTextSize="12sp"
    app:ibv_fixedBadgeRadius="15dp"
    app:ibv_badgeTextStyle="bold"
    app:ibv_badgeTextColor="#ffffff"
    app:ibv_badgeColor="#00ACC1"
    app:ibv_badgeLimitValue="false"
    android:src="@drawable/ic_shopping_cart" />

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:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <solid android:color="#ea5444"/>
    <corners android:radius="24dp"/>

    <stroke
        android:width="1dp"
        android:color="#f5f5f5"/>
</shape>

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.

image-support's People

Contributors

anangkur avatar nikartm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

image-support's Issues

Compiling gradle error

Hi I am new to android development. I tried to use this but got an error compiling the project. I am completely new to this and I don't know what's going on in build.gradle.

image

Any API to hide the badge

I did find the following methods:

  1. ibv_visibleBadge
  2. setShowCounter

But none of them seems to hide the badge itself
Version: io.github.nikartm:image-support:2.0.0

strings.xml in library project causes bug for app using localized strings

I'm using your library in a project with localization.

The strings.xml, which contains "app_name" key, causes my app locale cannot be configured after the settings language changed.
I have also checked other libraries and they don't have any strings.xml.

Could you check this? If it's good then please remove it and upgrade the new version. I really appreciate your contribution.

Always happy to hear from you. Thanks for reading.

Can we apply custom text?!

Can we apply custom text or even make badge number appear like (1k , 2k , 3M , 3B , ..... ) ?!
if not ... can you please support this in the future ?!

And Thanks for the amazing wok

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.