Skip to content

Commit

Permalink
Merge branch 'release/v4.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepenz committed Oct 18, 2019
2 parents 58fc953 + 6f275ff commit d68cb26
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 141 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [mikepenz]
25 changes: 2 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ A awesome gradle plugin which can automatically fetch a font from Fontastic, and
## 1. Provide the gradle dependency
```gradle
//the core iconics library (without any widgets)
implementation "com.mikepenz:iconics-core:4.0.1-b02"
implementation "com.mikepenz:iconics-core:4.0.1"
implementation "androidx.appcompat:appcompat:${versions.appCompat}"
```

## 1b. (optional) Add the view's dependency
```gradle
//this adds all ui view widgets (IconicsButton, IconicsImageView, ...)
implementation "com.mikepenz:iconics-views:4.0.1-b02"
implementation "com.mikepenz:iconics-views:4.0.1"
```

For the non kotlin variant please use a version smaller than 4.x.y (See the releases on GitHub)
Expand All @@ -95,27 +95,6 @@ implementation 'com.mikepenz:pixeden-7-stroke-typeface:1.2.0.3-kotlin@aar'
implementation 'com.mikepenz:material-design-icons-dx-typeface:5.0.1.0-kotlin@aar'
```

## 3. Define IconicsLayoutInflater to enable automatic xml icons detection (optional)
Set the `IconicsLayoutInflater` as new `LayoutInflaterFactory`. This will enable automatic icon detection for `TextViews`,`Buttons`, and allow you to set icons on `ImageView`'s via xml. This is compatible with libs which wrap the `baseContext` like [Calligraphy](https://github.com/chrisjenx/Calligraphy). This does not work on FAB's please use the `Context-Injection` instead.

```kotlin
override fun onCreate(savedInstanceState: Bundle?) {
layoutInflater.setIconicsFactory(delegate)
super.onCreate(savedInstanceState)
//...
//...
}
```

### 3. ALTERNATIVE: Inject into Context (optional)
Wrap the `Activity` context. This will enable the same features as Step 3.1., but is not compatible with other libs wrapping the `baseContext`.
```kotlin
override fun attachBaseContext(newBase: Context) {
super.attachBaseContext(newBase.wrapByIconics())
}
```


# Usage
## Use as drawable

Expand Down
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,18 @@ dependencies {
// used to fill the RecyclerView with the DrawerItems
// and provides single and multi selection, expandable items
// https://github.com/mikepenz/FastAdapter
implementation 'com.mikepenz:fastadapter:4.0.1'
implementation 'com.mikepenz:fastadapter-extensions-utils:4.0.1'
implementation 'com.mikepenz:fastadapter-extensions-ui:4.0.1'
implementation 'com.mikepenz:fastadapter-extensions-expandable:4.0.1'
implementation 'com.mikepenz:fastadapter:4.1.0'
implementation 'com.mikepenz:fastadapter-extensions-utils:4.1.0'
implementation 'com.mikepenz:fastadapter-extensions-ui:4.1.0'
implementation 'com.mikepenz:fastadapter-extensions-expandable:4.1.0'

// used to generating string fields for icons (sample - test/java/StringFieldGenerator.java)
// https://github.com/zTrap/Android-Iconics-String-Generator
testImplementation 'ru.ztrap.iconics:string-generator:1.0.4'

// used to generate the drawer on the left
// https://github.com/mikepenz/MaterialDrawer
implementation('com.mikepenz:materialdrawer:7.0.0-rc01') {
implementation('com.mikepenz:materialdrawer:7.0.0-rc08') {
transitive = true
exclude module: "fastadapter"
exclude module: "fastadapter-extensions-expandable"
Expand All @@ -111,7 +111,7 @@ dependencies {

// used to generate the Open Source section
// https://github.com/mikepenz/AboutLibraries
implementation('com.mikepenz:aboutlibraries:7.0.1') {
implementation('com.mikepenz:aboutlibraries:7.0.3') {
transitive = true
exclude module: "fastadapter"
exclude module: "iconics-core"
Expand Down
11 changes: 1 addition & 10 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2019 Mike Penz
~
~ Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -38,14 +37,6 @@
android:name=".PlaygroundActivity"
android:label="@string/title_activity_playground"
android:theme="@style/MaterialDrawerTheme.Light.DarkToolbar" />
<activity
android:name=".AutomaticActivity"
android:label="@string/title_activity_automatic"
android:theme="@style/MaterialDrawerTheme.Light.DarkToolbar" />
<activity
android:name=".OldAutomaticActivity"
android:label="@string/title_activity_old_automatic"
android:theme="@style/MaterialDrawerTheme.Light.ActionBar" />
</application>

</manifest>
42 changes: 0 additions & 42 deletions app/src/main/java/com/mikepenz/iconics/sample/AutomaticActivity.kt

This file was deleted.

10 changes: 1 addition & 9 deletions app/src/main/java/com/mikepenz/iconics/sample/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ class MainActivity : AppCompatActivity() {
.withName(font.fontName)
.withBadge(font.icons.size.toString())
.withDescription(if (font.author.isEmpty()) font.version else font.version + " - " + font.author)
.withBadgeStyle(BadgeStyle().withColorRes(R.color.md_grey_200))
.withIcon(getRandomIcon(font))
.withIdentifier(index.toLong())
.withBadgeStyle(BadgeStyle().withColorRes(R.color.md_grey_200))

if (font.mappingPrefix == "gmd") {
identifierGmd = index
Expand Down Expand Up @@ -197,14 +197,6 @@ class MainActivity : AppCompatActivity() {
startActivity(Intent(applicationContext, PlaygroundActivity::class.java))
return true
}
R.id.action_automatic -> {
startActivity(Intent(applicationContext, AutomaticActivity::class.java))
return true
}
R.id.action_old_automatic -> {
startActivity(Intent(applicationContext, OldAutomaticActivity::class.java))
return true
}
else -> return super.onOptionsItemSelected(item)
}
}
Expand Down

This file was deleted.

8 changes: 0 additions & 8 deletions app/src/main/res/menu/menu_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,4 @@
android:id="@+id/action_playground"
android:title="@string/action_playground"
app:showAsAction="never" />
<item
android:id="@+id/action_automatic"
android:title="@string/action_automatic"
app:showAsAction="never" />
<item
android:id="@+id/action_old_automatic"
android:title="@string/action_old_automatic"
app:showAsAction="never" />
</menu>
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@
buildscript {
ext {
release = [
versionName: "4.0.1-b02",
versionName: "4.0.1",
versionCode: 40010
]

setup = [
compileSdk: 29,
buildTools: "29.0.0",
buildTools: "29.0.2",
minSdk : 14,
targetSdk : 29
]

versions = [
kotlin : '1.3.50',
androidX : '1.0.0',
recyclerView : '1.1.0-beta01',
material : '1.1.0-alpha07',
appcompat : '1.1.0-rc01',
recyclerView : '1.1.0-beta05',
material : '1.1.0-beta01',
appcompat : '1.1.0',
drawerlayout : '1.1.0-alpha02',
constraintLayout: '2.0.0-beta2',
cardview : '1.0.0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import android.view.LayoutInflater
* Base created by Christopher Jenkins
* https://github.com/chrisjenx/Calligraphy
*/
@Deprecated(message = "Use the IconicsImageView or IconicsTextView instead")
class IconicsContextWrapper private constructor(base: Context) : ContextWrapper(base) {

private val inflater by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import androidx.core.view.LayoutInflaterFactory
/**
* Created by mikepenz on 01.12.15.
*/
@Deprecated(message = "Use the IconicsImageView or IconicsTextView instead")
class IconicsLayoutInflater(
private val appCompatDelegate: AppCompatDelegate
) : LayoutInflaterFactory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import androidx.appcompat.app.AppCompatDelegate
/**
* Created by bschnack on 07.18.17.
*/
@Deprecated(message = "Use the IconicsImageView or IconicsTextView instead")
class IconicsLayoutInflater2(
private val appCompatDelegate: AppCompatDelegate
) : LayoutInflater.Factory2 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import java.lang.reflect.Field
* Base created by Christopher Jenkins
* https://github.com/chrisjenx/Calligraphy
*/
@Deprecated(message = "Use the IconicsImageView or IconicsTextView instead")
internal class InternalLayoutInflater : LayoutInflater {
// Reflection Hax
private var isSetPrivateFactory = false
Expand Down

0 comments on commit d68cb26

Please sign in to comment.