Skip to content

Commit

Permalink
Merge pull request #595 from mikepenz/develop
Browse files Browse the repository at this point in the history
dev -> main
  • Loading branch information
mikepenz authored Jul 30, 2021
2 parents 13a4ae9 + b689f56 commit 0cf60a2
Show file tree
Hide file tree
Showing 16 changed files with 1,838 additions and 1,606 deletions.
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.7.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
ansi (1.5.0)
ast (2.4.1)
Expand Down Expand Up @@ -39,7 +39,7 @@ GEM
faraday (>= 0.8)
git (1.7.0)
rchardet (~> 1.8)
kramdown (2.3.0)
kramdown (2.3.1)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
Expand All @@ -55,7 +55,7 @@ GEM
open4 (1.3.4)
public_suffix (4.0.6)
rchardet (1.8.0)
rexml (3.2.4)
rexml (3.2.5)
ruby-ll (2.1.2)
ansi
ast
Expand Down
39 changes: 28 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@
- [Foundation Icons](http://zurb.com/playground/foundation-icon-fonts-3)
- [Ionicons](http://ionicons.com/)
- [Material Design DX](https://jossef.github.io/material-design-icons-iconfont/)
- [Pixeden 7 Stroke](https://themes-pixeden.com/font-demos/7-stroke/)
- [Phosphor](https://phosphoricons.com/)
- Or create your own font with any icon needed.

# Setup

## Latest releases 🛠

- Kotlin Next Gen | [v5.2.8](https://github.com/mikepenz/Android-Iconics/tree/v5.2.8) | [v5.3.0-b01](https://github.com/mikepenz/Android-Iconics/tree/v5.3.0-b01)
- Kotlin Next Gen | [v5.3.0](https://github.com/mikepenz/Android-Iconics/tree/v5.3.0)
- Kotlin | [v4.0.2](https://github.com/mikepenz/Android-Iconics/tree/v4.0.2)
- Java AndroidX | [v3.2.5](https://github.com/mikepenz/Android-Iconics/tree/v3.2.5)
- Java Appcompat | [v3.0.4](https://github.com/mikepenz/Android-Iconics/tree/v3.0.4)
Expand Down Expand Up @@ -159,19 +161,19 @@ This feature was suggested and initially provided by @dzamlo
#### As IconicsTextView
```xml
<com.mikepenz.iconics.view.IconicsTextView
android:text="abc{hif-test}defgh{faw-adjust}ijk{fon-test1}lmnopqrstuv{fon-test2}wxyz"
android:textColor="@android:color/black"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:textSize="16sp"/>
android:text="abc{hif-test}defgh{faw-adjust}ijk{fon-test1}lmnopqrstuv{fon-test2}wxyz"
android:textColor="@android:color/black"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:textSize="16sp"/>
```

#### As IconicsButton
```xml
<com.mikepenz.iconics.view.IconicsButton
android:text="{faw-adjust} Button"
android:layout_width="120dp"
android:layout_height="60dp"/>
android:text="{faw-adjust} Button"
android:layout_width="120dp"
android:layout_height="60dp"/>
```

## Compose
Expand Down Expand Up @@ -201,6 +203,8 @@ Image(
|[Google Material Design Icons](https://github.com/google/material-design-icons) **ORIGINAL by Google**|gmd,gmo,gmr,gms|implementation 'com.mikepenz:google-material-typeface{-outlined,rounded,sharp}:+@aar'|
|[Material Design Iconic Font](http://zavoloklom.github.io/material-design-iconic-font) **Google Material Iconic**|gmi|implementation 'com.mikepenz:material-design-iconic-typeface:+@aar'|
|[Fontawesome](https://fontawesome.com/)|faw|implementation 'com.mikepenz:fontawesome-typeface:+@aar'|
|[FontawesomeBrand](https://fontawesome.com/)|fab|implementation 'com.mikepenz:fontawesome-typeface:+@aar'|
|[FontawesomeRegular](https://fontawesome.com/)|far|implementation 'com.mikepenz:fontawesome-typeface:+@aar'|
|[Meteocons](http://www.alessioatzeni.com/meteocons/)|met|implementation 'com.mikepenz:meteocons-typeface:+@aar'|
|[Octicons](https://github.com/github/octicons)|oct|implementation 'com.mikepenz:octicons-typeface:+@aar'|
|[Community Material](http://materialdesignicons.com/)|cmd|implementation 'com.mikepenz:community-material-typeface:+@aar'|
Expand All @@ -216,6 +220,19 @@ Image(

Licenses for all included fonts are linked inside the class or can be found on the coresponding repositories.

# Compatibility Note

### appcompat:1.4.x

Appcompat v1.4.x introduces default enabled emoji support into all `AppCompat*` views, which prevents the `IconicsView*` views (iconics-views module) from properly applying the spannable style.
To fix this problem, emoji support has to be disabled by doing:

```xml
app:emojiCompatEnabled="false"
```

More information on the appcompat emoji support: https://developer.android.com/jetpack/androidx/releases/appcompat#1.4.0-alpha01

# Advanced Usage

### Register fonts
Expand All @@ -241,7 +258,7 @@ Just define the style for all icons or only a specific one. You can find this in
Iconics.Builder()
.style(ForegroundColorSpan(Color.WHITE), BackgroundColorSpan(Color.BLACK), RelativeSizeSpan(2f))
.styleFor(FontAwesome.Icon.faw_adjust, BackgroundColorSpan(Color.RED))
.on(tv1)
.on(tv1)
.build()
```

Expand Down Expand Up @@ -280,7 +297,7 @@ For generating string field for each of icons of your font, you can use this sim
A awesome gradle plugin which can automatically fetch a font from Fontastic, and generate the Android Module for your project.
[Iconics-Font-Generator](https://github.com/ligol/IconicsFontGenerator)

# ProGuard
# ProGuard / R8

ProGuard / R8 rules are bundled internally with each font.

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/mikepenz/iconics/sample/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import com.mikepenz.iconics.IconicsDrawable
import com.mikepenz.iconics.sample.databinding.ActivityMainBinding
import com.mikepenz.iconics.typeface.IIcon
import com.mikepenz.iconics.typeface.ITypeface
import com.mikepenz.iconics.typeface.library.fontawesome.FontAwesome
import com.mikepenz.iconics.typeface.library.fontawesome.FontAwesomeBrand
import com.mikepenz.iconics.typeface.library.materialdesigniconic.MaterialDesignIconic
import com.mikepenz.iconics.utils.actionBar
import com.mikepenz.iconics.utils.colorInt
Expand Down Expand Up @@ -174,7 +174,7 @@ class MainActivity : AppCompatActivity() {
})

val menuItem = menu.findItem(R.id.action_opensource)
menuItem.icon = IconicsDrawable(this, FontAwesome.Icon.faw_github).apply {
menuItem.icon = IconicsDrawable(this, FontAwesomeBrand.Icon.fab_github).apply {
actionBar()
colorInt = Color.WHITE
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import com.mikepenz.iconics.IconicsSize
import com.mikepenz.iconics.sample.databinding.ActivityPlaygroundBinding
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
import com.mikepenz.iconics.typeface.library.fontawesome.FontAwesome
import com.mikepenz.iconics.typeface.library.fontawesome.FontAwesomeBrand
import com.mikepenz.iconics.typeface.library.octicons.Octicons
import com.mikepenz.iconics.utils.actionBar
import com.mikepenz.iconics.utils.backgroundColorInt
Expand Down Expand Up @@ -92,7 +93,7 @@ class PlaygroundActivity : AppCompatActivity() {

//You can also do some advanced stuff like setting an image within a text
val sb = SpannableString(binding.test5.text)
val d = IconicsDrawable(this, FontAwesome.Icon.faw_android).apply {
val d = IconicsDrawable(this, FontAwesomeBrand.Icon.fab_android).apply {
sizeDp = 48
paddingDp = 4
colorInt = themeValue1
Expand All @@ -117,7 +118,7 @@ class PlaygroundActivity : AppCompatActivity() {

//Set the icon of an ImageView (or something else) as bitmap
binding.test3.setImageBitmap(
IconicsDrawable(this, FontAwesome.Icon.faw_android).apply {
IconicsDrawable(this, FontAwesomeBrand.Icon.fab_android).apply {
sizeX = IconicsSize.dp(48)
sizeY = IconicsSize.dp(32)
paddingDp = 4
Expand Down Expand Up @@ -160,7 +161,7 @@ class PlaygroundActivity : AppCompatActivity() {
backgroundColorInt = Color.RED
}
val array = IconicsArrayBuilder(iconicsDrawableBase)
.add(FontAwesome.Icon.faw_android)
.add(FontAwesomeBrand.Icon.fab_android)
.add(Octicons.Icon.oct_octoface)
.add("Hallo")
.add('A')
Expand Down
24 changes: 12 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,37 @@ buildscript {

ext {
release = [
versionName: "5.3.0-b01",
versionName: "5.3.0",
versionCode: 50300
]

setup = [
compileSdk : 30,
buildTools : "30.0.2",
buildTools : "30.0.3",
minSdk : 16,
composeMinSdk: 21,
targetSdk : 30
]

versions = [
kotlin : '1.4.31',
kotlin : '1.5.10',
androidX : '1.0.0',
recyclerView : '1.1.0',
material : '1.3.0',
appcompat : '1.2.0',
recyclerView : '1.2.1',
material : '1.4.0',
appcompat : '1.3.1',
drawerlayout : '1.1.0',
constraintLayout: '2.0.4',
cardview : '1.0.0',
ktx : [
core: '1.3.2'
core: '1.6.0'
],
startup : '1.0.0',
detekt : '1.16.0',
aboutLibraries : '8.8.4',
materialDrawer : '8.3.3',
fastAdapter : '5.3.5',
aboutLibraries : '8.9.1',
materialDrawer : '8.4.2',
fastAdapter : '5.4.1',
// compose
compose : '1.0.0-beta03'
compose : '1.0.0'
]
}

Expand All @@ -62,7 +62,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.0.0-alpha12'
classpath 'com.android.tools.build:gradle:7.1.0-alpha05'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${versions.detekt}"
classpath "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:${versions.aboutLibraries}"
Expand Down
4 changes: 2 additions & 2 deletions fontawesome-typeface-library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ android {
minSdkVersion setup.minSdk
targetSdkVersion setup.targetSdk
consumerProguardFiles 'consumer-proguard-rules.pro'
versionCode 59002
versionName "5.9.0.2-kotlin"
versionCode 51330
versionName "5.13.3.0-kotlin"

resValue "string", "fontawesome_version", "${versionName}"
}
Expand Down
Loading

0 comments on commit 0cf60a2

Please sign in to comment.