Code Monkey home page Code Monkey logo

droidicon's Introduction

droidicon - Over 1600 icons for Android!

Icons From...

New

* Updated FontAwesome to 4.3 * Unicode Icons * Your own custom icons

droidicon provides over 1600 customizable icons, 25 ready-made social badges and more! droidicon makes it super easy to add icons and badges to your app. All of the social badges are already styled. Just add them to your app! Or you can customize the icons however you want.

Based on IconicDroid

Ready-made Badges for Popular Social Networks using Company Brand Colors

Icon Examples

Add strokes, transparency, and color filters to your icons

MIT License

droidicon's People

Contributors

thedazzler avatar uglytroll 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  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

droidicon's Issues

Instagram Badge

I used the instagram badge but there's just a blue circle and the instagram icon was too tiny. Hope you can fix this. Other badges works well. Thank you!

droidicon noob question

So I have the xml like this (from your "how-to" section)

%lt;com.thedazzler.droidicon.badges.DroidiconBadge
android:layout_width="wrap_content"
android:layout_height="wrap_content"
droidicon:db_bg_color="@color/blue"
droidicon:db_icon_color="@color/white"
droidicon:db_icon="fa-user"
/>

But it doesn't draw the icon on my layout, whatelse do I need to do?

Creating a icon circular background programatically.

Hi,

I am wondering how can i create a icon with circular background?

what am i trying to do:

IconicFontDrawable iconicFontDrawable = new IconicFontDrawable(this.getApplicationContext());
iconicFontDrawable.setIcon("fa-thumbs-up");
iconicFontDrawable.setIconColor(getResources().getColor(R.color.light_blue));

//setBackground will fulfill the whole view with icon

i saw issue #19 however setBackgroundColor is not present anymore.

Can somebody help me?

Thanks

NullPointerException on updateTextSize

Hi, I recently stumbled upon a weird error saying NullPointerException on updateTextSize. Any suggestion or insight why this happen?

Fatal Exception: java.lang.NullPointerException: Attempt to get length of null array
       at com.thedazzler.droidicon.IconicFontDrawable.updateTextSize(IconicFontDrawable.java:245)
       at com.thedazzler.droidicon.IconicFontDrawable.draw(IconicFontDrawable.java:181)
       at android.widget.TextView.onDraw(TextView.java:5040)
       at android.view.View.draw(View.java:13560)
       at android.view.View.getDisplayList(View.java:12511)
       at android.view.View.getDisplayList(View.java:12555)
       at android.view.View.draw(View.java:13284)
       at android.view.ViewGroup.drawChild(ViewGroup.java:2990)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2860)
       at android.view.View.getDisplayList(View.java:12509)
       at android.view.View.getDisplayList(View.java:12555)
       at android.view.View.draw(View.java:13284)
       at android.view.ViewGroup.drawChild(ViewGroup.java:2990)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2860)
       at android.view.View.getDisplayList(View.java:12509)
       at android.view.View.getDisplayList(View.java:12555)
       at android.view.View.draw(View.java:13284)
       at android.view.ViewGroup.drawChild(ViewGroup.java:2990)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2860)
       at android.view.View.getDisplayList(View.java:12509)
       at android.view.View.getDisplayList(View.java:12555)
       at android.view.View.draw(View.java:13284)
       at android.view.ViewGroup.drawChild(ViewGroup.java:2990)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2860)
       at android.view.View.draw(View.java:13563)
       at android.widget.FrameLayout.draw(FrameLayout.java:467)
       at android.view.View.getDisplayList(View.java:12511)
       at android.view.View.getDisplayList(View.java:12555)
       at android.view.View.draw(View.java:13284)
       at android.view.ViewGroup.drawChild(ViewGroup.java:2990)
       at android.widget.ListView.drawChild(ListView.java:3245)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2860)
       at android.widget.AbsListView.dispatchDraw(AbsListView.java:2631)
       at android.widget.ListView.dispatchDraw(ListView.java:3240)
       at android.view.View.draw(View.java:13563)
       at android.widget.AbsListView.draw(AbsListView.java:4219)
       at android.view.View.getDisplayList(View.java:12511)
       at android.view.View.getDisplayList(View.java:12555)
       at android.view.View.draw(View.java:13284)
       at android.view.ViewGroup.drawChild(ViewGroup.java:2990)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2867)
       at android.view.View.draw(View.java:13563)
       at android.view.View.getDisplayList(View.java:12511)
       at android.view.View.getDisplayList(View.java:12555)
       at android.view.View.draw(View.java:13284)
       at android.view.ViewGroup.drawChild(ViewGroup.java:2990)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2860)
       at android.view.View.getDisplayList(View.java:12509)
       at android.view.View.getDisplayList(View.java:12555)
       at android.view.View.draw(View.java:13284)
       at android.view.ViewGroup.drawChild(ViewGroup.java:2990)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2860)
       at android.view.View.getDisplayList(View.java:12509)
       at android.view.View.getDisplayList(View.java:12555)
       at android.view.View.draw(View.java:13284)
       at android.view.ViewGroup.drawChild(ViewGroup.java:2990)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2860)
       at android.view.View.getDisplayList(View.java:12509)
       at android.view.View.getDisplayList(View.java:12555)
       at android.view.View.draw(View.java:13284)
       at android.view.ViewGroup.drawChild(ViewGroup.java:2990)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2860)
       at android.view.View.getDisplayList(View.java:12509)
       at android.view.View.getDisplayList(View.java:12555)
       at android.view.View.draw(View.java:13284)
       at android.view.ViewGroup.drawChild(ViewGroup.java:2990)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2860)
       at android.view.View.getDisplayList(View.java:12509)
       at android.view.View.getDisplayList(View.java:12555)
       at android.view.View.draw(View.java:13284)
       at android.view.ViewGroup.drawChild(ViewGroup.java:2990)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2860)
       at android.view.View.draw(View.java:13563)
       at android.widget.FrameLayout.draw(FrameLayout.java:467)
       at android.view.View.getDisplayList(View.java:12511)
       at android.view.View.getDisplayList(View.java:12555)
       at android.view.View.draw(View.java:13284)
       at android.view.ViewGroup.drawChild(ViewGroup.java:2990)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2860)
       at android.view.View.getDisplayList(View.java:12509)
       at android.view.View.getDisplayList(View.java:12555)
       at android.view.View.draw(View.java:13284)
       at android.view.ViewGroup.drawChild(ViewGroup.java:2990)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2860)
       at android.view.View.getDisplayList(View.java:12509)
       at android.view.View.getDisplayList(View.java:12555)
       at android.view.View.draw(View.java:13284)
       at android.view.ViewGroup.drawChild(ViewGroup.java:2990)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2860)
       at android.view.View.getDisplayList(View.java:12509)
       at android.view.View.getDisplayList(View.java:12555)
       at android.view.View.draw(View.java:13284)
       at android.view.ViewGroup.drawChild(ViewGroup.java:2990)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2860)
       at android.view.View.draw(View.java:13563)
       at android.widget.FrameLayout.draw(FrameLayout.java:467)
       at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2458)
       at android.view.View.getDisplayList(View.java:12511)
       at android.view.View.getDisplayList(View.java:12555)
       at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1144)
       at android.view.ViewRootImpl.draw(ViewRootImpl.java:2273)
       at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2145)
       at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1956)
       at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1113)
       at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4481)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
       at android.view.Choreographer.doCallbacks(Choreographer.java:555)
       at android.view.Choreographer.doFrame(Choreographer.java:525)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
       at android.os.Handler.handleCallback(Handler.java:615)
       at android.os.Handler.dispatchMessage(Handler.java:92)
       at android.os.Looper.loop(Looper.java:137)
       at android.app.ActivityThread.main(ActivityThread.java:4867)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:511)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
       at dalvik.system.NativeStart.main(NativeStart.java)

Thanks :)

No icon shown on certain os versions

Hi,

I have a clean project created in Android Studio with DroidIcon added via Gradle. Using the example layout shown below the icon appears perfectly on a Nexus 5 running Lollipop, and a Nexus 5 on OS 21 .. but on a Galaxy S1 (yes, 1 :-p) running OS 18, no icon is shown, just the circular background .. the same happens on a Nexus 7. I don't think it's an OS issue, I get the feeling it's more to do with screen density or something because if I go to this method

private void updateTextSize(Rect viewBounds)

.. and edit out the second setTextSize, which is after the delta is applied, the icons appear on all devices .. far too big and cut off, but they do appear, so the missing icon might not be to do with the icon not displaying at all, just that it displays too small after the delta is applied?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:droidicon="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    tools:context=".MainActivity$PlaceholderFragment">

    <com.thedazzler.droidicon.badges.DroidiconBadge
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        droidicon:db_bg_color="@android:color/black"
        droidicon:db_icon_color="@android:color/white"
        droidicon:db_icon="fa-user"
        />

</RelativeLayout>

Any ideas on how to fix this? I'm happy to give it a go myself if you point me in the right direction!

Thanks,

Steven

Change DroidiconBadge background programmatically

I have a button in my code like this. Note that I have the circular background be transparent:

                <com.thedazzler.droidicon.badges.DroidiconBadge
                    android:id="@+id/nav_calibration_badge"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    droidicon:db_bg_color="@android:color/transparent"
                    droidicon:db_icon_color="#f44336"
                    droidicon:db_icon="fa-compass"
                    droidicon:db_size="36dp"
                    droidicon:db_icon_padding="8dp"/>

I'm trying to find a way to change the background color in code, but I'm not how to do so. Using DroidiconBadge.setBackground(...) changes the background to a square.

Instagram icon appears very small

Hi there,
I use droidicon for my app and it works great. Now I need the instagram icon and I have followed the same steps as usual, just like the facebook icon. The logo of instagram appears like 1 pixel in size compared to facebook, but the code is the same. See below and see attached screenshot.

Can anyone help me? Thanks.

See Image

<com.thedazzler.droidicon.badges.FacebookDroidiconBadge
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
app:db_size="40dp"
android:id="@+id/am_iv_facebook" />

                <com.thedazzler.droidicon.badges.InstagramDroidiconBadge
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="10dp"
                    android:layout_marginEnd="10dp"
                    app:db_size="40dp"
                    android:id="@+id/am_iv_instagram" />

Put on jCenter

Instead of having to import the source code and add the project as a gradle subproject, it would be easier if you put droidicon on jCenter so one could simply do

repositories {
    jcenter()
}

dependencies {
    compile 'com.thedazzler.droidicon:droidicon:1.0'
}

If you need any help, feel free to ask.

Icons not centered in Android Nougat (24)

I realise this library is probably discontinued now, but if anyone has any tips on how to get the icons to center in the middle of the circles for Android 24+, I'd be very grateful. To recreate this, just create a new project that supports 24 and runs on a device with 24, the custom icon will appear in the bottom left.

Thanks

Question: ImageView.setImageDrawable possible?

    IconicFontDrawable icon = new IconicFontDrawable(context);
    icon.setIcon("fa-trash");
    icon.setIconColor(context.getResources().getColor(R.color.white));
    deleteImg.setImageDrawable(icon);

This will draw nothing on the ImageView... I noticed that your "how-to" was using "setBackground" instead but I cannot seem to use setImageDrawable, because setBackground seems to scale the image with the parent container.

Any tips?

Attribute "rippleColor" has already been defined

compile 'com.android.support:design:23.0.0'

after adding the above library, Gradle build failed with error,

/SOURCE_CODE_PATH/build/intermediates/exploded-aar/com.github.theDazzler/droidicon/0.1.3/res/values/values.xml
Error:(2) Attribute "rippleColor" has already been defined
Error:Execution failed for task ':core:processReleaseResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/shahabuddin/Library/Android/sdk/build-tools/23.0.0/aapt'' finished with non-zero exit value 1

Removing the support design library resolves the problem.

Add setIcon to DroidiconBadge

Is it possible to add a setIcon(String) method to DroidconBadge?
Something like

 public void setIcon(String icon){

    iconicFontDrawable = new IconicFontDrawable(getContext());
    iconicFontDrawable.setIcon(icon);
    iconicFontDrawable.setIconColor(iconColor);
    iconicFontDrawable.setIconPadding((int) icon_padding);
    iconicFontDrawable.setContourColor(contourColor);
    iconicFontDrawable.setContour(contourColor, contourWidth);
    iconicFontDrawable.drawContour(drawContour);
    iconicFontDrawable.setAlpha(alpha);


    if (SDK_INT < JELLY_BEAN) {
        view_icon.setBackgroundDrawable(iconicFontDrawable);
    } else {
        view_icon.setBackground(iconicFontDrawable);
    }
}

This would be very useful in adapters where xml inflating is not available.

setting db_icon_padding removes the icon

I have the following:

           <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:padding="@dimen/spacing_large"
                android:background="@color/red"
                >
                <com.thedazzler.droidicon.badges.DroidiconBadge
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:background="@color/orange"
                    app:db_icon_color="@color/white"
                    app:db_icon="gmd-warning"
                    app:db_icon_padding="1dp"
                    android:foregroundGravity="center_vertical"
                    />
                <TextView
                    android:layout_weight="1"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:text="Warning!."
                    android:textColor="@color/white"
                    />
          </LinearLayout>

When I add the db_icon_padding="1dp", the icon isn't displayed. If I remove it, the icon is shown as expected.

Quick question

How do I use METEOCONS? What would the icon name be?

Thanks

Issues on Android Lollipop

When using a custom icon (tried several icon sets) on Android Lollipop, the icon itself is very small (and stays that way despite changing it's size via droidicon:db_size.
The circle resizes appropriately however.

Tried the same code on a device running Android 4.4.4 on which it works as expected.

Code used:

<com.thedazzler.droidicon.badges.DroidiconBadge
        android:layout_centerHorizontal="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        droidicon:db_bg_color="@color/blue_800"
        droidicon:db_icon_color="@color/white"
        droidicon:db_icon="gmd-person"
        droidicon:db_size="130dp"
        />

Custom icon doesn't show

So I did a test with a pre built icon and a custom icon. The premade icon show correctly but the custom icon just shows a green circle with an android in it. Even I specified the icon the in the xml like so? Please help?

<LinearLayout
xmlns:droidicon="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.thedazzler.droidicon.badges.AndroidDroidiconBadge
android:layout_width="wrap_content"
android:layout_height="wrap_content"
droidicon:db_bg_color="@color/black"
droidicon:db_icon_color="@color/white"
droidicon:db_icon="fa-user"
/>
<com.thedazzler.droidicon.badges.VimeoDroidiconBadge
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="4dp"
/>
</LinearLayout>

screenshot_2014-12-04-09-48-33

Manifest merger failed - mipmap/ic_launcher

I'm using Android Studio 1.2 RC. I've just added the lib (version 0.1.9) to build.gradle and I get the following error:

Error:(23, 9) Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest.xml:23:9
Error:(23, 9) Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest.xml:23:9
    is also present at com.github.theDazzler:droidicon:0.1.9:13:9 value=(@drawable/ic_launcher)
    Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:20:5 to override

At the Manifest, on line 23, inside the application tag, I have android:icon="@mipmap/ic_launcher".
The project was created with Android Studio 1.2, which uses mipmap for icons and other drawables - you have a folder res/drawables and then folders res/mipmap-hdpi, res/mipmap-xhdpi etcetera.

I've added the tools:replace="android:icon"inside the applicationtag and the error disappears.

adding icons to buttons and menues

I want to replace the i cons i use in navigation view with droidicon where i use menu layout.
this is my current layout:

  <menu xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_gravity="end">
<group android:id="@+id/menu_group_1"
    android:checkableBehavior="single">
    <item
        android:id="@+id/menu_latest_news"
        android:checked="true"
        android:icon="@drawable/ic_earth_grey600_24dp"
        android:title="@string/menu.drawer.stories.latest" />
    <item
        android:id="@+id/drawar_menu_saved_stories"
        android:icon="@drawable/ic_download_grey600_24dp"
        android:title="@string/menu.drawer.stories.saved" />
    <item
        android:id="@+id/drawar_menu_sources"
        android:icon="@drawable/analytics_gray"
        android:title="@string/menu.drawer.stories.resources" />
    <item

My question is how can i add droidicon to my layout. Also how can i add icons programaticaly?

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.