├── .gitignore ├── LICENSE ├── README.md ├── build.gradle ├── fancyad.png ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── ion ├── build.gradle ├── proguard-rules.txt └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── be │ │ └── webelite │ │ └── ion │ │ ├── Icon.java │ │ └── IconView.java │ └── res │ ├── anim │ └── rotate_left_1.xml │ ├── raw │ └── ionicons.ttf │ └── values │ ├── attrs.xml │ └── strings.xml ├── maven └── be │ └── webelite │ └── ion-iconview │ ├── 1.0.4 │ ├── ion-iconview-1.0.4.aar │ ├── ion-iconview-1.0.4.aar.md5 │ ├── ion-iconview-1.0.4.aar.sha1 │ ├── ion-iconview-1.0.4.pom │ ├── ion-iconview-1.0.4.pom.md5 │ └── ion-iconview-1.0.4.pom.sha1 │ ├── maven-metadata.xml │ ├── maven-metadata.xml.md5 │ └── maven-metadata.xml.sha1 ├── sample ├── build.gradle ├── proguard-rules.txt └── src │ └── main │ ├── AndroidManifest.xml │ ├── ic_launcher-web.png │ ├── java │ └── be │ │ └── webelite │ │ └── ioniconviewsample │ │ ├── IconListAdapter.java │ │ └── MainActivity.java │ └── res │ ├── drawable-hdpi │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ ├── layout │ ├── activity_main.xml │ └── icon_list_item.xml │ ├── menu │ └── main.xml │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── sample_application.gif └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | # built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # files for the dex VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # generated files 12 | bin/ 13 | gen/ 14 | 15 | # Local configuration file (sdk path, etc) 16 | local.properties 17 | 18 | # Eclipse project files 19 | .classpath 20 | .project 21 | 22 | # Android Studio 23 | .idea/ 24 | .gradle 25 | */local.properties 26 | */out 27 | 28 | */build 29 | */production 30 | 31 | *.iml 32 | *.iws 33 | *.ipr 34 | *~ 35 | *.swp -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | IonIcons: Copyright (c) 2013 Drifty (http://drifty.com/) 4 | InoIconView: Copyright (c) 2014 Marzpet Vardanyan (http://webelite.be) 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![IonIconView](https://raw.github.com/MarsVard/IonIconView/master/fancyad.png "the fancy ad") 2 | 3 | Usage 4 | ===== 5 | 6 | Add the repository and dependency to your project 7 | 8 | Add this line to the root layout in your xml 9 | ```xml 10 | xmlns:ioniconview="http://schemas.android.com/apk/res-auto" 11 | ``` 12 | 13 | now you can use iconviews and populate view the with any of [these](http://ionicons.com/) icons 14 | 15 | ```xml 16 | 21 | android:textSize="40dp" 22 | android:textColor="#ff0000" 23 | /> 24 | ``` 25 | 26 | Available Icons 27 | ===== 28 | for a list of available icons please check out [ionicons.com](http://ionicons.com/) 29 | ion-loading becomes ion_loading 30 | ion-ionic becomes ion_ionic 31 | 32 | Credits 33 | ===== 34 | All credits go out to [ionicons.com](http://ionicons.com/) 35 | 36 | 37 | Maven Repository 38 | ===== 39 | 40 | Ready to use android library including rotating icons! 41 | 42 | To use, add the following to your project's build.gradle file: 43 | 44 | ```gradle 45 | 46 | repositories { 47 | maven { url 'https://github.com/MarsVard/IonIconView/raw/master/maven' } 48 | } 49 | 50 | dependencies { 51 | compile 'be.webelite:ion-iconview:1.0.+@aar' 52 | } 53 | 54 | ``` 55 | 56 | thanks to @Sonelli for explaining how maven works :) 57 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:0.7.+' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | mavenCentral() 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /fancyad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarsVard/IonIconView/6d6f0b21305ce7f3c282867b90662697a1e84c99/fancyad.png -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Settings specified in this file will override any Gradle settings 5 | # configured through the IDE. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarsVard/IonIconView/6d6f0b21305ce7f3c282867b90662697a1e84c99/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=http\://services.gradle.org/distributions/gradle-1.9-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /ion/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'android-library' 2 | apply plugin: 'maven' 3 | uploadArchives { 4 | repositories { 5 | mavenDeployer { 6 | // Deploy to a local repository 7 | repository(url: "file://C://android-studio-projects//ioniconview//maven//") 8 | pom.groupId = 'be.webelite' 9 | pom.artifactId = 'ion-iconview' 10 | pom.version = '1.0.4' 11 | pom.packaging = 'aar' 12 | } 13 | } 14 | } 15 | android { 16 | compileSdkVersion 19 17 | buildToolsVersion "19.0.0" 18 | 19 | defaultConfig { 20 | minSdkVersion 7 21 | targetSdkVersion 19 22 | versionCode 1 23 | versionName "1.0" 24 | } 25 | release { 26 | runProguard false 27 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ion/proguard-rules.txt: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:/android/android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the ProGuard 5 | # include property in project.properties. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} -------------------------------------------------------------------------------- /ion/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /ion/src/main/java/be/webelite/ion/Icon.java: -------------------------------------------------------------------------------- 1 | package be.webelite.ion; 2 | 3 | /** 4 | * Created by Aper on 15/01/14. 5 | */ 6 | public enum Icon { 7 | ion_alert(0xf101), 8 | ion_alert_circled(0xf100), 9 | ion_android_add(0xf2c7), 10 | ion_android_add_contact(0xf2c6), 11 | ion_android_alarm(0xf2c8), 12 | ion_android_archive(0xf2c9), 13 | ion_android_arrow_back(0xf2ca), 14 | ion_android_arrow_down_left(0xf2cb), 15 | ion_android_arrow_down_right(0xf2cc), 16 | ion_android_arrow_up_left(0xf2cd), 17 | ion_android_arrow_up_right(0xf2ce), 18 | ion_android_battery(0xf2cf), 19 | ion_android_book(0xf2d0), 20 | ion_android_calendar(0xf2d1), 21 | ion_android_call(0xf2d2), 22 | ion_android_camera(0xf2d3), 23 | ion_android_chat(0xf2d4), 24 | ion_android_checkmark(0xf2d5), 25 | ion_android_clock(0xf2d6), 26 | ion_android_close(0xf2d7), 27 | ion_android_contact(0xf2d8), 28 | ion_android_contacts(0xf2d9), 29 | ion_android_data(0xf2da), 30 | ion_android_developer(0xf2db), 31 | ion_android_display(0xf2dc), 32 | ion_android_download(0xf2dd), 33 | ion_android_dropdown(0xf2de), 34 | ion_android_earth(0xf2df), 35 | ion_android_folder(0xf2e0), 36 | ion_android_forums(0xf2e1), 37 | ion_android_friends(0xf2e2), 38 | ion_android_hand(0xf2e3), 39 | ion_android_image(0xf2e4), 40 | ion_android_inbox(0xf2e5), 41 | ion_android_information(0xf2e6), 42 | ion_android_keypad(0xf2e7), 43 | ion_android_lightbulb(0xf2e8), 44 | ion_android_locate(0xf2e9), 45 | ion_android_location(0xf2ea), 46 | ion_android_mail(0xf2eb), 47 | ion_android_microphone(0xf2ec), 48 | ion_android_mixer(0xf2ed), 49 | ion_android_more(0xf2ee), 50 | ion_android_note(0xf2ef), 51 | ion_android_playstore(0xf2f0), 52 | ion_android_printer(0xf2f1), 53 | ion_android_promotion(0xf2f2), 54 | ion_android_reminder(0xf2f3), 55 | ion_android_remove(0xf2f4), 56 | ion_android_search(0xf2f5), 57 | ion_android_send(0xf2f6), 58 | ion_android_settings(0xf2f7), 59 | ion_android_share(0xf2f8), 60 | ion_android_social(0xf2fa), 61 | ion_android_social_user(0xf2f9), 62 | ion_android_sort(0xf2fb), 63 | ion_android_star(0xf2fc), 64 | ion_android_stopwatch(0xf2fd), 65 | ion_android_storage(0xf2fe), 66 | ion_android_system_back(0xf2ff), 67 | ion_android_system_home(0xf300), 68 | ion_android_system_windows(0xf301), 69 | ion_android_timer(0xf302), 70 | ion_android_trash(0xf303), 71 | ion_android_volume(0xf304), 72 | ion_android_wifi(0xf305), 73 | ion_archive(0xf102), 74 | ion_arrow_down_a(0xf103), 75 | ion_arrow_down_b(0xf104), 76 | ion_arrow_down_c(0xf105), 77 | ion_arrow_expand(0xf25e), 78 | ion_arrow_graph_down_left(0xf25f), 79 | ion_arrow_graph_down_right(0xf260), 80 | ion_arrow_graph_up_left(0xf261), 81 | ion_arrow_graph_up_right(0xf262), 82 | ion_arrow_left_a(0xf106), 83 | ion_arrow_left_b(0xf107), 84 | ion_arrow_left_c(0xf108), 85 | ion_arrow_move(0xf263), 86 | ion_arrow_resize(0xf264), 87 | ion_arrow_return_left(0xf265), 88 | ion_arrow_return_right(0xf266), 89 | ion_arrow_right_a(0xf109), 90 | ion_arrow_right_b(0xf10a), 91 | ion_arrow_right_c(0xf10b), 92 | ion_arrow_shrink(0xf267), 93 | ion_arrow_swap(0xf268), 94 | ion_arrow_up_a(0xf10c), 95 | ion_arrow_up_b(0xf10d), 96 | ion_arrow_up_c(0xf10e), 97 | ion_at(0xf10f), 98 | ion_bag(0xf110), 99 | ion_battery_charging(0xf111), 100 | ion_battery_empty(0xf112), 101 | ion_battery_full(0xf113), 102 | ion_battery_half(0xf114), 103 | ion_battery_low(0xf115), 104 | ion_beaker(0xf269), 105 | ion_beer(0xf26a), 106 | ion_bluetooth(0xf116), 107 | ion_bookmark(0xf26b), 108 | ion_briefcase(0xf26c), 109 | ion_bug(0xf2be), 110 | ion_calculator(0xf26d), 111 | ion_calendar(0xf117), 112 | ion_camera(0xf118), 113 | ion_card(0xf119), 114 | ion_chatbox(0xf11b), 115 | ion_chatbox_working(0xf11a), 116 | ion_chatboxes(0xf11c), 117 | ion_chatbubble(0xf11e), 118 | ion_chatbubble_working(0xf11d), 119 | ion_chatbubbles(0xf11f), 120 | ion_checkmark(0xf122), 121 | ion_checkmark_circled(0xf120), 122 | ion_checkmark_round(0xf121), 123 | ion_chevron_down(0xf123), 124 | ion_chevron_left(0xf124), 125 | ion_chevron_right(0xf125), 126 | ion_chevron_up(0xf126), 127 | ion_clipboard(0xf127), 128 | ion_clock(0xf26e), 129 | ion_close(0xf12a), 130 | ion_close_circled(0xf128), 131 | ion_close_round(0xf129), 132 | ion_cloud(0xf12b), 133 | ion_code(0xf271), 134 | ion_code_download(0xf26f), 135 | ion_code_working(0xf270), 136 | ion_coffee(0xf272), 137 | ion_compass(0xf273), 138 | ion_compose(0xf12c), 139 | ion_connection_bars(0xf274), 140 | ion_contrast(0xf275), 141 | ion_disc(0xf12d), 142 | ion_document(0xf12f), 143 | ion_document_text(0xf12e), 144 | ion_drag(0xf130), 145 | ion_earth(0xf276), 146 | ion_edit(0xf2bf), 147 | ion_egg(0xf277), 148 | ion_eject(0xf131), 149 | ion_email(0xf132), 150 | ion_eye(0xf133), 151 | ion_eye_disabled(0xf306), 152 | ion_female(0xf278), 153 | ion_filing(0xf134), 154 | ion_film_marker(0xf135), 155 | ion_flag(0xf279), 156 | ion_flash(0xf137), 157 | ion_flash_off(0xf136), 158 | ion_flask(0xf138), 159 | ion_folder(0xf139), 160 | ion_fork(0xf27a), 161 | ion_fork_repo(0xf2c0), 162 | ion_forward(0xf13a), 163 | ion_game_controller_a(0xf13b), 164 | ion_game_controller_b(0xf13c), 165 | ion_gear_a(0xf13d), 166 | ion_gear_b(0xf13e), 167 | ion_grid(0xf13f), 168 | ion_hammer(0xf27b), 169 | ion_headphone(0xf140), 170 | ion_heart(0xf141), 171 | ion_help(0xf143), 172 | ion_help_buoy(0xf27c), 173 | ion_help_circled(0xf142), 174 | ion_home(0xf144), 175 | ion_icecream(0xf27d), 176 | ion_icon_social_google_plus(0xf146), 177 | ion_icon_social_google_plus_outline(0xf145), 178 | ion_image(0xf147), 179 | ion_images(0xf148), 180 | ion_information(0xf14a), 181 | ion_information_circled(0xf149), 182 | ion_ionic(0xf14b), 183 | ion_ios7_alarm(0xf14d), 184 | ion_ios7_alarm_outline(0xf14c), 185 | ion_ios7_albums(0xf14f), 186 | ion_ios7_albums_outline(0xf14e), 187 | ion_ios7_arrow_back(0xf150), 188 | ion_ios7_arrow_down(0xf151), 189 | ion_ios7_arrow_forward(0xf152), 190 | ion_ios7_arrow_left(0xf153), 191 | ion_ios7_arrow_right(0xf154), 192 | ion_ios7_arrow_thin_down(0xf27e), 193 | ion_ios7_arrow_thin_left(0xf27f), 194 | ion_ios7_arrow_thin_right(0xf280), 195 | ion_ios7_arrow_thin_up(0xf281), 196 | ion_ios7_arrow_up(0xf155), 197 | ion_ios7_at(0xf157), 198 | ion_ios7_at_outline(0xf156), 199 | ion_ios7_bell(0xf159), 200 | ion_ios7_bell_outline(0xf158), 201 | ion_ios7_bolt(0xf15b), 202 | ion_ios7_bolt_outline(0xf15a), 203 | ion_ios7_bookmarks(0xf15d), 204 | ion_ios7_bookmarks_outline(0xf15c), 205 | ion_ios7_box(0xf15f), 206 | ion_ios7_box_outline(0xf15e), 207 | ion_ios7_briefcase(0xf283), 208 | ion_ios7_briefcase_outline(0xf282), 209 | ion_ios7_browsers(0xf161), 210 | ion_ios7_browsers_outline(0xf160), 211 | ion_ios7_calculator(0xf285), 212 | ion_ios7_calculator_outline(0xf284), 213 | ion_ios7_calendar(0xf163), 214 | ion_ios7_calendar_outline(0xf162), 215 | ion_ios7_camera(0xf165), 216 | ion_ios7_camera_outline(0xf164), 217 | ion_ios7_cart(0xf167), 218 | ion_ios7_cart_outline(0xf166), 219 | ion_ios7_chatboxes(0xf169), 220 | ion_ios7_chatboxes_outline(0xf168), 221 | ion_ios7_chatbubble(0xf16b), 222 | ion_ios7_chatbubble_outline(0xf16a), 223 | ion_ios7_checkmark(0xf16e), 224 | ion_ios7_checkmark_empty(0xf16c), 225 | ion_ios7_checkmark_outline(0xf16d), 226 | ion_ios7_circle_filled(0xf16f), 227 | ion_ios7_circle_outline(0xf170), 228 | ion_ios7_clock(0xf172), 229 | ion_ios7_clock_outline(0xf171), 230 | ion_ios7_close(0xf2bc), 231 | ion_ios7_close_empty(0xf2bd), 232 | ion_ios7_close_outline(0xf2bb), 233 | ion_ios7_cloud(0xf178), 234 | ion_ios7_cloud_download(0xf174), 235 | ion_ios7_cloud_download_outline(0xf173), 236 | ion_ios7_cloud_outline(0xf175), 237 | ion_ios7_cloud_upload(0xf177), 238 | ion_ios7_cloud_upload_outline(0xf176), 239 | ion_ios7_cloudy(0xf17a), 240 | ion_ios7_cloudy_night(0xf308), 241 | ion_ios7_cloudy_night_outline(0xf307), 242 | ion_ios7_cloudy_outline(0xf179), 243 | ion_ios7_cog(0xf17c), 244 | ion_ios7_cog_outline(0xf17b), 245 | ion_ios7_compose(0xf17e), 246 | ion_ios7_compose_outline(0xf17d), 247 | ion_ios7_contact(0xf180), 248 | ion_ios7_contact_outline(0xf17f), 249 | ion_ios7_copy(0xf182), 250 | ion_ios7_copy_outline(0xf181), 251 | ion_ios7_download(0xf184), 252 | ion_ios7_download_outline(0xf183), 253 | ion_ios7_drag(0xf185), 254 | ion_ios7_email(0xf187), 255 | ion_ios7_email_outline(0xf186), 256 | ion_ios7_eye(0xf189), 257 | ion_ios7_eye_outline(0xf188), 258 | ion_ios7_fastforward(0xf18b), 259 | ion_ios7_fastforward_outline(0xf18a), 260 | ion_ios7_filing(0xf18d), 261 | ion_ios7_filing_outline(0xf18c), 262 | ion_ios7_film(0xf18f), 263 | ion_ios7_film_outline(0xf18e), 264 | ion_ios7_flag(0xf191), 265 | ion_ios7_flag_outline(0xf190), 266 | ion_ios7_folder(0xf193), 267 | ion_ios7_folder_outline(0xf192), 268 | ion_ios7_gear(0xf195), 269 | ion_ios7_gear_outline(0xf194), 270 | ion_ios7_glasses(0xf197), 271 | ion_ios7_glasses_outline(0xf196), 272 | ion_ios7_heart(0xf199), 273 | ion_ios7_heart_outline(0xf198), 274 | ion_ios7_help(0xf19c), 275 | ion_ios7_help_empty(0xf19a), 276 | ion_ios7_help_outline(0xf19b), 277 | ion_ios7_infinite(0xf19e), 278 | ion_ios7_infinite_outline(0xf19d), 279 | ion_ios7_information(0xf1a1), 280 | ion_ios7_information_empty(0xf19f), 281 | ion_ios7_information_outline(0xf1a0), 282 | ion_ios7_ionic_outline(0xf1a2), 283 | ion_ios7_keypad(0xf1a4), 284 | ion_ios7_keypad_outline(0xf1a3), 285 | ion_ios7_lightbulb(0xf287), 286 | ion_ios7_lightbulb_outline(0xf286), 287 | ion_ios7_location(0xf1a6), 288 | ion_ios7_location_outline(0xf1a5), 289 | ion_ios7_locked(0xf1a8), 290 | ion_ios7_locked_outline(0xf1a7), 291 | ion_ios7_medkit(0xf289), 292 | ion_ios7_medkit_outline(0xf288), 293 | ion_ios7_mic(0xf1ab), 294 | ion_ios7_mic_off(0xf1a9), 295 | ion_ios7_mic_outline(0xf1aa), 296 | ion_ios7_minus(0xf1ae), 297 | ion_ios7_minus_empty(0xf1ac), 298 | ion_ios7_minus_outline(0xf1ad), 299 | ion_ios7_monitor(0xf1b0), 300 | ion_ios7_monitor_outline(0xf1af), 301 | ion_ios7_moon(0xf1b2), 302 | ion_ios7_moon_outline(0xf1b1), 303 | ion_ios7_more(0xf1b4), 304 | ion_ios7_more_outline(0xf1b3), 305 | ion_ios7_musical_note(0xf1b5), 306 | ion_ios7_musical_notes(0xf1b6), 307 | ion_ios7_navigate(0xf1b8), 308 | ion_ios7_navigate_outline(0xf1b7), 309 | ion_ios7_paperplane(0xf1ba), 310 | ion_ios7_paperplane_outline(0xf1b9), 311 | ion_ios7_partlysunny(0xf1bc), 312 | ion_ios7_partlysunny_outline(0xf1bb), 313 | ion_ios7_pause(0xf1be), 314 | ion_ios7_pause_outline(0xf1bd), 315 | ion_ios7_people(0xf1c0), 316 | ion_ios7_people_outline(0xf1bf), 317 | ion_ios7_person(0xf1c2), 318 | ion_ios7_person_outline(0xf1c1), 319 | ion_ios7_personadd(0xf1c4), 320 | ion_ios7_personadd_outline(0xf1c3), 321 | ion_ios7_photos(0xf1c6), 322 | ion_ios7_photos_outline(0xf1c5), 323 | ion_ios7_pie(0xf28b), 324 | ion_ios7_pie_outline(0xf28a), 325 | ion_ios7_play(0xf1c8), 326 | ion_ios7_play_outline(0xf1c7), 327 | ion_ios7_plus(0xf1cb), 328 | ion_ios7_plus_empty(0xf1c9), 329 | ion_ios7_plus_outline(0xf1ca), 330 | ion_ios7_pricetag(0xf28d), 331 | ion_ios7_pricetag_outline(0xf28c), 332 | ion_ios7_printer(0xf1cd), 333 | ion_ios7_printer_outline(0xf1cc), 334 | ion_ios7_rainy(0xf1cf), 335 | ion_ios7_rainy_outline(0xf1ce), 336 | ion_ios7_recording(0xf1d1), 337 | ion_ios7_recording_outline(0xf1d0), 338 | ion_ios7_redo(0xf1d3), 339 | ion_ios7_redo_outline(0xf1d2), 340 | ion_ios7_refresh(0xf1d6), 341 | ion_ios7_refresh_empty(0xf1d4), 342 | ion_ios7_refresh_outline(0xf1d5), 343 | ion_ios7_reload(0xf28e), 344 | ion_ios7_reloading(0xf28e), 345 | ion_ios7_rewind(0xf1d8), 346 | ion_ios7_rewind_outline(0xf1d7), 347 | ion_ios7_search(0xf1da), 348 | ion_ios7_search_strong(0xf1d9), 349 | ion_ios7_skipbackward(0xf1dc), 350 | ion_ios7_skipbackward_outline(0xf1db), 351 | ion_ios7_skipforward(0xf1de), 352 | ion_ios7_skipforward_outline(0xf1dd), 353 | ion_ios7_snowy(0xf309), 354 | ion_ios7_speedometer(0xf290), 355 | ion_ios7_speedometer_outline(0xf28f), 356 | ion_ios7_star(0xf1e0), 357 | ion_ios7_star_outline(0xf1df), 358 | ion_ios7_stopwatch(0xf1e2), 359 | ion_ios7_stopwatch_outline(0xf1e1), 360 | ion_ios7_sunny(0xf1e4), 361 | ion_ios7_sunny_outline(0xf1e3), 362 | ion_ios7_telephone(0xf1e6), 363 | ion_ios7_telephone_outline(0xf1e5), 364 | ion_ios7_thunderstorm(0xf1e8), 365 | ion_ios7_thunderstorm_outline(0xf1e7), 366 | ion_ios7_time(0xf292), 367 | ion_ios7_time_outline(0xf291), 368 | ion_ios7_timer(0xf1ea), 369 | ion_ios7_timer_outline(0xf1e9), 370 | ion_ios7_trash(0xf1ec), 371 | ion_ios7_trash_outline(0xf1eb), 372 | ion_ios7_undo(0xf1ee), 373 | ion_ios7_undo_outline(0xf1ed), 374 | ion_ios7_unlocked(0xf1f0), 375 | ion_ios7_unlocked_outline(0xf1ef), 376 | ion_ios7_upload(0xf1f2), 377 | ion_ios7_upload_outline(0xf1f1), 378 | ion_ios7_videocam(0xf1f4), 379 | ion_ios7_videocam_outline(0xf1f3), 380 | ion_ios7_volume_high(0xf1f5), 381 | ion_ios7_volume_low(0xf1f6), 382 | ion_ios7_wineglass(0xf294), 383 | ion_ios7_wineglass_outline(0xf293), 384 | ion_ios7_world(0xf1f8), 385 | ion_ios7_world_outline(0xf1f7), 386 | ion_ipad(0xf1f9), 387 | ion_iphone(0xf1fa), 388 | ion_ipod(0xf1fb), 389 | ion_jet(0xf295), 390 | ion_key(0xf296), 391 | ion_knife(0xf297), 392 | ion_laptop(0xf1fc), 393 | ion_leaf(0xf1fd), 394 | ion_levels(0xf298), 395 | ion_lightbulb(0xf299), 396 | ion_link(0xf1fe), 397 | ion_load_a(0xf29a), 398 | ion_loading_a(0xf29a), 399 | ion_load_b(0xf29b), 400 | ion_loading_b(0xf29b), 401 | ion_load_c(0xf29c), 402 | ion_loading_c(0xf29c), 403 | ion_load_d(0xf29d), 404 | ion_loading_d(0xf29d), 405 | ion_location(0xf1ff), 406 | ion_locked(0xf200), 407 | ion_log_in(0xf29e), 408 | ion_log_out(0xf29f), 409 | ion_loop(0xf201), 410 | ion_looping(0xf201), 411 | ion_magnet(0xf2a0), 412 | ion_male(0xf2a1), 413 | ion_man(0xf202), 414 | ion_map(0xf203), 415 | ion_medkit(0xf2a2), 416 | ion_mic_a(0xf204), 417 | ion_mic_b(0xf205), 418 | ion_mic_c(0xf206), 419 | ion_minus(0xf209), 420 | ion_minus_circled(0xf207), 421 | ion_minus_round(0xf208), 422 | ion_model_s(0xf2c1), 423 | ion_monitor(0xf20a), 424 | ion_more(0xf20b), 425 | ion_music_note(0xf20c), 426 | ion_navicon(0xf20e), 427 | ion_navicon_round(0xf20d), 428 | ion_navigate(0xf2a3), 429 | ion_no_smoking(0xf2c2), 430 | ion_nuclear(0xf2a4), 431 | ion_paper_airplane(0xf2c3), 432 | ion_paperclip(0xf20f), 433 | ion_pause(0xf210), 434 | ion_person(0xf213), 435 | ion_person_add(0xf211), 436 | ion_person_stalker(0xf212), 437 | ion_pie_graph(0xf2a5), 438 | ion_pin(0xf2a6), 439 | ion_pinpoint(0xf2a7), 440 | ion_pizza(0xf2a8), 441 | ion_plane(0xf214), 442 | ion_play(0xf215), 443 | ion_playstation(0xf30a), 444 | ion_plus(0xf218), 445 | ion_plus_circled(0xf216), 446 | ion_plus_round(0xf217), 447 | ion_pound(0xf219), 448 | ion_power(0xf2a9), 449 | ion_pricetag(0xf2aa), 450 | ion_pricetags(0xf2ab), 451 | ion_printer(0xf21a), 452 | ion_radio_waves(0xf2ac), 453 | ion_record(0xf21b), 454 | ion_refresh(0xf21c), 455 | ion_refreshing(0xf21c), 456 | ion_reply(0xf21e), 457 | ion_reply_all(0xf21d), 458 | ion_search(0xf21f), 459 | ion_settings(0xf2ad), 460 | ion_share(0xf220), 461 | ion_shuffle(0xf221), 462 | ion_skip_backward(0xf222), 463 | ion_skip_forward(0xf223), 464 | ion_social_android(0xf225), 465 | ion_social_android_outline(0xf224), 466 | ion_social_apple(0xf227), 467 | ion_social_apple_outline(0xf226), 468 | ion_social_bitcoin(0xf2af), 469 | ion_social_bitcoin_outline(0xf2ae), 470 | ion_social_buffer(0xf229), 471 | ion_social_buffer_outline(0xf228), 472 | ion_social_designernews(0xf22b), 473 | ion_social_designernews_outline(0xf22a), 474 | ion_social_dribbble(0xf22d), 475 | ion_social_dribbble_outline(0xf22c), 476 | ion_social_dropbox(0xf22f), 477 | ion_social_dropbox_outline(0xf22e), 478 | ion_social_facebook(0xf231), 479 | ion_social_facebook_outline(0xf230), 480 | ion_social_freebsd_devil(0xf2c4), 481 | ion_social_github(0xf233), 482 | ion_social_github_outline(0xf232), 483 | ion_social_googleplus(0xf235), 484 | ion_social_googleplus_outline(0xf234), 485 | ion_social_hackernews(0xf237), 486 | ion_social_hackernews_outline(0xf236), 487 | ion_social_linkedin(0xf239), 488 | ion_social_linkedin_outline(0xf238), 489 | ion_social_pinterest(0xf2b1), 490 | ion_social_pinterest_outline(0xf2b0), 491 | ion_social_reddit(0xf23b), 492 | ion_social_reddit_outline(0xf23a), 493 | ion_social_rss(0xf23d), 494 | ion_social_rss_outline(0xf23c), 495 | ion_social_skype(0xf23f), 496 | ion_social_skype_outline(0xf23e), 497 | ion_social_tumblr(0xf241), 498 | ion_social_tumblr_outline(0xf240), 499 | ion_social_tux(0xf2c5), 500 | ion_social_twitter(0xf243), 501 | ion_social_twitter_outline(0xf242), 502 | ion_social_vimeo(0xf245), 503 | ion_social_vimeo_outline(0xf244), 504 | ion_social_windows(0xf247), 505 | ion_social_windows_outline(0xf246), 506 | ion_social_wordpress(0xf249), 507 | ion_social_wordpress_outline(0xf248), 508 | ion_social_yahoo(0xf24b), 509 | ion_social_yahoo_outline(0xf24a), 510 | ion_social_youtube(0xf24d), 511 | ion_social_youtube_outline(0xf24c), 512 | ion_speakerphone(0xf2b2), 513 | ion_speedometer(0xf2b3), 514 | ion_spoon(0xf2b4), 515 | ion_star(0xf24e), 516 | ion_stats_bars(0xf2b5), 517 | ion_steam(0xf30b), 518 | ion_stop(0xf24f), 519 | ion_thermometer(0xf2b6), 520 | ion_thumbsdown(0xf250), 521 | ion_thumbsup(0xf251), 522 | ion_trash_a(0xf252), 523 | ion_trash_b(0xf253), 524 | ion_umbrella(0xf2b7), 525 | ion_unlocked(0xf254), 526 | ion_upload(0xf255), 527 | ion_usb(0xf2b8), 528 | ion_videocamera(0xf256), 529 | ion_volume_high(0xf257), 530 | ion_volume_low(0xf258), 531 | ion_volume_medium(0xf259), 532 | ion_volume_mute(0xf25a), 533 | ion_waterdrop(0xf25b), 534 | ion_wifi(0xf25c), 535 | ion_wineglass(0xf2b9), 536 | ion_woman(0xf25d), 537 | ion_wrench(0xf2ba), 538 | ion_xbox(0xf30c); 539 | 540 | int unicode_value; // unicode 541 | Icon(int unicode_value){ 542 | this.unicode_value = unicode_value; 543 | } 544 | } -------------------------------------------------------------------------------- /ion/src/main/java/be/webelite/ion/IconView.java: -------------------------------------------------------------------------------- 1 | package be.webelite.ion; 2 | 3 | import android.content.Context; 4 | import android.content.res.Resources; 5 | import android.content.res.TypedArray; 6 | import android.graphics.Typeface; 7 | import android.util.AttributeSet; 8 | import android.util.Log; 9 | import android.view.animation.AnimationUtils; 10 | import android.widget.TextView; 11 | 12 | import java.io.BufferedOutputStream; 13 | import java.io.File; 14 | import java.io.FileOutputStream; 15 | import java.io.IOException; 16 | import java.io.InputStream; 17 | import java.util.Arrays; 18 | 19 | /** 20 | * Created by Aper on 15/01/14. 21 | */ 22 | class TypeFaceWrapper { 23 | private static Typeface ionfont; 24 | 25 | static Typeface getTypeface() { 26 | return ionfont; 27 | } 28 | 29 | static void setParameter(Typeface ionfont) { 30 | TypeFaceWrapper.ionfont = ionfont; 31 | } 32 | } 33 | public class IconView extends TextView { 34 | 35 | public static int ROT_LEFT_NORMAL = 0; 36 | public static int ROT_LEFT_STEPS = 1; 37 | 38 | protected final String icons_rot_left_1[] = new String[]{ 39 | "ion_refreshing", "ion_looping", "ion_loading_b", 40 | "ion_loading_c", "ion_loading_d", "ion_ios7_reloading" 41 | }; 42 | 43 | public IconView(Context context) { 44 | super(context); 45 | } 46 | 47 | public IconView(Context context, AttributeSet attrs) { 48 | super(context, attrs); 49 | init(attrs); 50 | } 51 | 52 | public IconView(Context context, AttributeSet attrs, int defStyle) { 53 | super(context, attrs, defStyle); 54 | init(attrs); 55 | } 56 | 57 | protected void init(AttributeSet attrs){ 58 | // set correct unicode character as text 59 | TypedArray a = getContext().obtainStyledAttributes(attrs, be.webelite.ion.R.styleable.icon); 60 | String icon_name = a.getString(be.webelite.ion.R.styleable.icon_name); 61 | 62 | if(icon_name != null){ 63 | Icon icon = Icon.valueOf(icon_name); 64 | this.setIcon(icon); 65 | }else{ 66 | return; 67 | } 68 | a.recycle(); 69 | 70 | if(!isInEditMode()){ 71 | 72 | // read typeface only once! 73 | // yey performance :) 74 | if(TypeFaceWrapper.getTypeface() == null){ 75 | TypeFaceWrapper.setParameter(this.getFontFromRes(R.raw.ionicons, getContext())); 76 | } 77 | 78 | this.setTypeface(TypeFaceWrapper.getTypeface()); 79 | } 80 | 81 | } 82 | 83 | public void setIcon(Icon icon){ 84 | this.setText( Character.toString( (char) icon.unicode_value) ); 85 | 86 | if(Arrays.asList(icons_rot_left_1).contains(icon.toString())){ 87 | this.setAnimation(IconView.ROT_LEFT_NORMAL); 88 | }else{ 89 | this.clearAnimation(); 90 | } 91 | } 92 | 93 | public static Typeface getFontFromRes(int resource, Context context) 94 | { 95 | Typeface tf = null; 96 | InputStream is = null; 97 | try { 98 | is = context.getResources().openRawResource(resource); 99 | } 100 | catch(Resources.NotFoundException e) { 101 | Log.e("getFontFromRes", "Could not find font in resources!"); 102 | } 103 | 104 | String outPath = context.getCacheDir() + "/tmp" + System.currentTimeMillis() + ".raw"; 105 | 106 | try 107 | { 108 | byte[] buffer = new byte[is.available()]; 109 | BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(outPath)); 110 | 111 | int l = 0; 112 | while((l = is.read(buffer)) > 0) 113 | bos.write(buffer, 0, l); 114 | 115 | bos.close(); 116 | 117 | tf = Typeface.createFromFile(outPath); 118 | 119 | // clean up 120 | new File(outPath).delete(); 121 | } 122 | catch (IOException e) 123 | { 124 | Log.e("getFontFromRes", "Error reading in font!"); 125 | return null; 126 | } 127 | 128 | Log.d("getFontFromRes", "Successfully loaded font."); 129 | 130 | return tf; 131 | } 132 | 133 | public void setAnimation(int animation){ 134 | switch(animation){ 135 | case 0: // ROT_LEFT_NORMAL 136 | this.startAnimation( AnimationUtils.loadAnimation(getContext(), R.anim.rotate_left_1) ); 137 | break; 138 | case 1: // ROT_LEFT_STEPS TODO 139 | this.startAnimation( AnimationUtils.loadAnimation(getContext(), R.anim.rotate_left_1) ); 140 | break; 141 | } 142 | } 143 | public void stopAnimation(){ 144 | this.clearAnimation(); 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /ion/src/main/res/anim/rotate_left_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /ion/src/main/res/raw/ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarsVard/IonIconView/6d6f0b21305ce7f3c282867b90662697a1e84c99/ion/src/main/res/raw/ionicons.ttf -------------------------------------------------------------------------------- /ion/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ion/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | IonIconView 3 | 4 | -------------------------------------------------------------------------------- /maven/be/webelite/ion-iconview/1.0.4/ion-iconview-1.0.4.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarsVard/IonIconView/6d6f0b21305ce7f3c282867b90662697a1e84c99/maven/be/webelite/ion-iconview/1.0.4/ion-iconview-1.0.4.aar -------------------------------------------------------------------------------- /maven/be/webelite/ion-iconview/1.0.4/ion-iconview-1.0.4.aar.md5: -------------------------------------------------------------------------------- 1 | 3548a613aa6f8c0069dd3f42b6484850 -------------------------------------------------------------------------------- /maven/be/webelite/ion-iconview/1.0.4/ion-iconview-1.0.4.aar.sha1: -------------------------------------------------------------------------------- 1 | de82637bed516aaf2e8be5c4ff5763dc58b6df8c -------------------------------------------------------------------------------- /maven/be/webelite/ion-iconview/1.0.4/ion-iconview-1.0.4.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | be.webelite 6 | ion-iconview 7 | 1.0.4 8 | aar 9 | 10 | -------------------------------------------------------------------------------- /maven/be/webelite/ion-iconview/1.0.4/ion-iconview-1.0.4.pom.md5: -------------------------------------------------------------------------------- 1 | b4b3784cac91d5ff5636ca49c5941406 -------------------------------------------------------------------------------- /maven/be/webelite/ion-iconview/1.0.4/ion-iconview-1.0.4.pom.sha1: -------------------------------------------------------------------------------- 1 | c0eb6b6f39dc7852d8e478eadce15c681867194d -------------------------------------------------------------------------------- /maven/be/webelite/ion-iconview/maven-metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | be.webelite 4 | ion-iconview 5 | 1.0.4 6 | 7 | 8 | 1.0.4 9 | 10 | 20140118092115 11 | 12 | 13 | -------------------------------------------------------------------------------- /maven/be/webelite/ion-iconview/maven-metadata.xml.md5: -------------------------------------------------------------------------------- 1 | a867307c747a0da0bdd7dc859e06d9c3 -------------------------------------------------------------------------------- /maven/be/webelite/ion-iconview/maven-metadata.xml.sha1: -------------------------------------------------------------------------------- 1 | 5b35ff89bd9d7df4de28e24674eba7f593489619 -------------------------------------------------------------------------------- /sample/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'android' 2 | 3 | android { 4 | compileSdkVersion 18 5 | buildToolsVersion "19.0.0" 6 | 7 | defaultConfig { 8 | minSdkVersion 14 9 | targetSdkVersion 19 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | runProguard false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile 'com.android.support:appcompat-v7:+' 23 | compile project(':ion'); 24 | } 25 | -------------------------------------------------------------------------------- /sample/proguard-rules.txt: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:/android/android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the ProGuard 5 | # include property in project.properties. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} -------------------------------------------------------------------------------- /sample/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /sample/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarsVard/IonIconView/6d6f0b21305ce7f3c282867b90662697a1e84c99/sample/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /sample/src/main/java/be/webelite/ioniconviewsample/IconListAdapter.java: -------------------------------------------------------------------------------- 1 | package be.webelite.ioniconviewsample; 2 | 3 | import android.content.Context; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.BaseAdapter; 8 | import android.widget.TextView; 9 | 10 | import java.util.ArrayList; 11 | 12 | import be.webelite.ion.Icon; 13 | import be.webelite.ion.IconView; 14 | 15 | /** 16 | * Created by Aper on 16/01/14. 17 | */ 18 | public class IconListAdapter extends BaseAdapter { 19 | 20 | private final Context context; 21 | private Icon[] icons = Icon.values(); 22 | public IconListAdapter(Context ctx){ 23 | this.context = ctx; 24 | } 25 | @Override 26 | public int getCount() { 27 | return icons.length; 28 | } 29 | 30 | @Override 31 | public Icon getItem(int position) { 32 | return icons[position]; 33 | } 34 | 35 | @Override 36 | public long getItemId(int position) { 37 | return 0+position; 38 | } 39 | 40 | @Override 41 | public View getView(int position, View convertView, ViewGroup parent) { 42 | if(convertView == null){ 43 | LayoutInflater lf = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 44 | convertView = lf.inflate(R.layout.icon_list_item, parent, false); 45 | } 46 | IconView iv = (IconView) convertView.findViewById(R.id.icon_view); 47 | TextView tv = (TextView) convertView.findViewById(R.id.icon_name); 48 | 49 | iv.setIcon(getItem(position)); 50 | tv.setText(getItem(position).toString()); 51 | return convertView; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /sample/src/main/java/be/webelite/ioniconviewsample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package be.webelite.ioniconviewsample; 2 | 3 | import android.graphics.Color; 4 | import android.support.v7.app.ActionBarActivity; 5 | import android.support.v7.app.ActionBar; 6 | import android.support.v4.app.Fragment; 7 | import android.os.Bundle; 8 | import android.view.LayoutInflater; 9 | import android.view.Menu; 10 | import android.view.MenuItem; 11 | import android.view.View; 12 | import android.view.ViewGroup; 13 | import android.os.Build; 14 | import android.widget.GridLayout; 15 | import android.widget.ListView; 16 | 17 | import java.util.Random; 18 | 19 | import be.webelite.ion.IconView; 20 | 21 | public class MainActivity extends ActionBarActivity { 22 | 23 | @Override 24 | protected void onCreate(Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | setContentView(R.layout.activity_main); 27 | 28 | IconListAdapter ila = new IconListAdapter(this); 29 | ( (ListView) findViewById(R.id.iconlist) ).setAdapter(ila); 30 | 31 | } 32 | 33 | 34 | @Override 35 | public boolean onCreateOptionsMenu(Menu menu) { 36 | 37 | // Inflate the menu; this adds items to the action bar if it is present. 38 | getMenuInflater().inflate(R.menu.main, menu); 39 | return true; 40 | } 41 | 42 | @Override 43 | public boolean onOptionsItemSelected(MenuItem item) { 44 | 45 | // Handle action bar item clicks here. The action bar will 46 | // automatically handle clicks on the Home/Up button, so long 47 | // as you specify a parent activity in AndroidManifest.xml. 48 | int id = item.getItemId(); 49 | if (id == R.id.action_settings) { 50 | return true; 51 | } 52 | return super.onOptionsItemSelected(item); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarsVard/IonIconView/6d6f0b21305ce7f3c282867b90662697a1e84c99/sample/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarsVard/IonIconView/6d6f0b21305ce7f3c282867b90662697a1e84c99/sample/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarsVard/IonIconView/6d6f0b21305ce7f3c282867b90662697a1e84c99/sample/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarsVard/IonIconView/6d6f0b21305ce7f3c282867b90662697a1e84c99/sample/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 9 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/icon_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 20 | 26 | -------------------------------------------------------------------------------- /sample/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /sample/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /sample/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ff4F8EF7 4 | -------------------------------------------------------------------------------- /sample/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | 50dp 7 | 5dp 8 | 9 | -------------------------------------------------------------------------------- /sample/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | IonIconView 5 | Hello world! 6 | Settings 7 | 8 | 9 | -------------------------------------------------------------------------------- /sample/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sample_application.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarsVard/IonIconView/6d6f0b21305ce7f3c282867b90662697a1e84c99/sample_application.gif -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':ion', ':sample' 2 | --------------------------------------------------------------------------------