Skip to content

Commit

Permalink
Merge pull request #18 from MarcinOrlowski/dev
Browse files Browse the repository at this point in the history
v3.1.5
  • Loading branch information
MarcinOrlowski authored Jul 12, 2020
2 parents abcc970 + 5387a70 commit 528e1bb
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 64 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Changelog
=========
* v3.1.5 (2020-07-11)
- Converted demo application class to Koltin
- Corrected Space widget usage

* v3.1.4 (2019-05-08)
- Fixed `get()` not being properly exported.
- Internal library code cleanup.
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ Fonty

[![Repository](https://img.shields.io/badge/repo-GitHub-blue.svg)](https://github.com/MarcinOrlowski/fonty)
![License](https://img.shields.io/github/license/MarcinOrlowski/fonty.svg)
[![Dependency Status](https://dependencyci.com/github/MarcinOrlowski/Fonty/badge)](https://dependencyci.com/github/MarcinOrlowski/Fonty)


[![Curent Release](https://jitpack.io/v/MarcinOrlowski/fonty.svg)](https://jitpack.io/#MarcinOrlowski/fonty)
![jitpack Downloads](https://jitpack.io/v/MarcinOrlowski/Fonty/month.svg)
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Fonty-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/5489)
Expand All @@ -16,7 +15,7 @@ Fonty
consistency across your Fragments or Activities. If you want different fonts per each widget, then
`Fonty` is most likely not what you need.

Using `Fonty` requires **no change** to your layout files and all you need to do is to initialize
Using `Fonty` requires **no change** to your layout files and all you need to do is to initialize
the library and specify what typeface you want to be used as normal, italic or boldfaced ones.

![Screenshot](img/shot.png)
Expand Down Expand Up @@ -147,10 +146,10 @@ Toolbars
by `Fonty` in some cases. This is due to `Toolbar`'s internals as it simply have not instance of `TextView`
created unless title or subtitle is set (even to empty string), so there's nothing `Fonty` can manipulate
in advance.
The simples solution is to set toolbar title (and/or subtitle) in `onCreate()` causing `EditText`

The simples solution is to set toolbar title (and/or subtitle) in `onCreate()` causing `EditText`
creation prior calling `Fonty.setFonts()`:

@Override
protected void onCreate(Bundle state) {
super.onCreate(bundle);
Expand All @@ -166,7 +165,7 @@ Toolbars
Fonty.setFonts(this);
}

Alternatively, you can edit/create base activity class for your app with the following code:

private Toolbar mActivityActionBarToolbar;
Expand Down Expand Up @@ -202,7 +201,7 @@ TextInputLayout
and you want error text typeface to be changed by `Fonty` as well, then you must either set
`app:errorEnabled="true"` in the XML layout or call `setErrorEnabled(true)` on the object
**prior** calling `Fonty.setFonts()`. This is because of how `TextInputLayout` works internally.

**NOTE:** Typeface used for hints and error messages will be derrived from one set for `EditText`.


Expand Down Expand Up @@ -235,6 +234,6 @@ Contributing
License
=======

* Written and copyrighted &copy;2013-2019 by Marcin Orlowski <mail (#) marcinorlowski (.) com>
* Written and copyrighted &copy;2013-2020 by Marcin Orlowski <mail (#) marcinorlowski (.) com>
* `Fonty` is open-sourced library licensed under the Apache 2.0 license

10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion

//noinspection HighAppVersionCode
versionCode 2019050801
versionName '3.1.3'
versionCode 2020071101
versionName '3.1.5'
}
buildTypes {
release {
Expand All @@ -36,12 +36,12 @@ android {
}

dependencies {
implementation "com.google.android.material:material:1.0.0-rc01"
implementation "com.google.android.material:material:1.3.0-alpha01"
implementation "androidx.cardview:cardview:1.0.0"
implementation "androidx.appcompat:appcompat:1.0.0"
implementation "androidx.appcompat:appcompat:1.3.0-alpha01"

// ButterKnife: https://github.com/JakeWharton/butterknife
ext.butterknifeVersion = "10.0.0"
ext.butterknifeVersion = "10.2.1"
implementation "com.jakewharton:butterknife:$butterknifeVersion"
annotationProcessor "com.jakewharton:butterknife-compiler:$butterknifeVersion"

Expand Down
30 changes: 0 additions & 30 deletions app/src/main/java/com/marcinorlowski/fonty/demo/Application.java

This file was deleted.

26 changes: 26 additions & 0 deletions app/src/main/java/com/marcinorlowski/fonty/demo/Application.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.marcinorlowski.fonty.demo

import android.app.Application
import com.marcinorlowski.fonty.Fonty.Companion.context

/**
******************************************************************************
*
* Copyright 2013-2020 Marcin Orlowski <github@MarcinOrlowski.com>
*
* Licensed under the Apache License 2.0
*
******************************************************************************
*/
class Application : Application() {
override fun onCreate() {
super.onCreate()
context(this)
// .fontDir("otherFolder")
// .typefaceFallback(false)
.italicTypeface("Aramis-Italic.ttf")
.normalTypeface("Exo-Regular.ttf")
.boldTypeface("Capture_it.ttf")
.build()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import butterknife.Unbinder
/**
******************************************************************************
*
* Copyright 2013-2019 Marcin Orlowski <github@MarcinOrlowski.com>
* Copyright 2013-2020 Marcin Orlowski <github@MarcinOrlowski.com>
*
* Licensed under the Apache License 2.0
*
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/layout/content.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
android:padding="8dp"
tools:context="com.marcinorlowski.fonty.demo.MainActivity">


<androidx.legacy.widget.Space
<Space
android:layout_width="match_parent"
android:layout_height="32dp"/>

Expand Down
18 changes: 9 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
apply plugin: 'com.github.ben-manes.versions'

ext {
compileSdkVersion = 30
targetSdkVersion = 30
minSdkVersion = 16
buildToolsVersion = '30.0.1'
}

buildscript {
ext.kotlin_version = '1.3.21'
ext.kotlin_version = '1.3.72'
repositories {
google()
jcenter()
Expand All @@ -12,21 +19,14 @@ buildscript {
// https://github.com/ben-manes/gradle-versions-plugin
// Usage: gradlew dependencyUpdates task to check dependency versions
// also needs apply plugin: 'com.github.ben-manes.versions'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.28.0'

// jitpack.io
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

ext {
compileSdkVersion = 28
targetSdkVersion = 28
minSdkVersion = 16
buildToolsVersion = '28.0.3'
}

allprojects {
repositories {
google()
Expand Down
8 changes: 4 additions & 4 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion

//noinspection HighAppVersionCode
versionCode 2019050801
versionName '3.1.4'
versionCode 2020071101
versionName '3.1.5'
}
buildTypes {
release {
Expand All @@ -33,8 +33,8 @@ android {
}

dependencies {
implementation "androidx.appcompat:appcompat:1.0.0"
implementation "com.google.android.material:material:1.0.0-rc01"
implementation "androidx.appcompat:appcompat:1.3.0-alpha01"
implementation "com.google.android.material:material:1.3.0-alpha01"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/main/java/com/marcinorlowski/fonty/Cache.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import java.util.Hashtable
/**
******************************************************************************
*
* Copyright 2013-2019 Marcin Orlowski <github@MarcinOrlowski.com>
* Copyright 2013-2020 Marcin Orlowski <github@MarcinOrlowski.com>
*
* Licensed under the Apache License 2.0
*
Expand Down
2 changes: 1 addition & 1 deletion lib/src/main/java/com/marcinorlowski/fonty/Fonty.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import androidx.annotation.StringRes
/**
******************************************************************************
*
* Copyright 2013-2019 Marcin Orlowski <github@MarcinOrlowski.com>
* Copyright 2013-2020 Marcin Orlowski <github@MarcinOrlowski.com>
*
* Licensed under the Apache License 2.0
*
Expand Down
2 changes: 1 addition & 1 deletion lib/src/main/java/com/marcinorlowski/fonty/TypefaceSpan.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import android.text.style.MetricAffectingSpan
/**
******************************************************************************
*
* Copyright 2013-2019 Marcin Orlowski <github@MarcinOrlowski.com>
* Copyright 2013-2020 Marcin Orlowski <github@MarcinOrlowski.com>
*
* Licensed under the Apache License 2.0
*
Expand Down
2 changes: 1 addition & 1 deletion lib/src/main/java/com/marcinorlowski/fonty/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import android.util.Log
/**
******************************************************************************
*
* Copyright 2013-2019 Marcin Orlowski <github@MarcinOrlowski.com>
* Copyright 2013-2020 Marcin Orlowski <github@MarcinOrlowski.com>
*
* Licensed under the Apache License 2.0
*
Expand Down

0 comments on commit 528e1bb

Please # to comment.