Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project migrated to new Gradle build system #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,28 @@
# Local configuration file (sdk path, etc)
*/local.properties

# Mac OS X clutter
*.DS_Store

# local build config items
SparkCore/res/values/local_build.xml
# Android Studio
.idea/

# Ignore gradle files
.gradle/
build/
Fontify/build/

# Eclipse project files
# COMMENTED OUT: we want these.
#.classpath
#.project
# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Eclipse
.classpath
.project
.metadata

*/.metadata/
*/.settings/
# Licensed
app/libs/smartconfiglib.jar
app/src/main/assets/fonts/gotham*
21 changes: 21 additions & 0 deletions Android.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/classes/main" />
<output-test url="file://$MODULE_DIR$/build/classes/test" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

33 changes: 0 additions & 33 deletions Fontify/.gitignore

This file was deleted.

7 changes: 4 additions & 3 deletions Fontify/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
android:minSdkVersion="7"
android:targetSdkVersion="21" />

<application android:allowBackup="true" >
<application
android:allowBackup="true" >
</application>

</manifest>
87 changes: 87 additions & 0 deletions Fontify/Fontify.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":Fontify" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" />
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
<option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugTestSources" />
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
<option name="LIBRARY_PROJECT" value="true" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/test/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/test/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 20 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

14 changes: 14 additions & 0 deletions Fontify/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apply plugin: 'android-library'

android {
compileSdkVersion 20
buildToolsVersion '20.0.0'

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
2 changes: 1 addition & 1 deletion Fontify/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-19
target=android-17
android.library=true
23 changes: 22 additions & 1 deletion Fontify/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,33 @@ Fontify is an Android library project providing drop-in replacements for all And
<style name="CustomTextViewStyle">
<item name="font">@string/FONT_HELVETICA</item>
</style>
2) Use the Fontify subclass of your TextView:
2) Use the Fontify subclass of your TextView:

<com.danh32.fontify.TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/CustomTextViewStyle" />

3) You can also declare a default Fontify font as part of your Application theme so that every Fontified element will use the same font:

a. Declare the style as in (1) above

b. While still in res/values/styles.xml, add the following attribute to your Application theme:

<!-- Application theme. Android Studio default example - your theme names may differ -->
<style name="AppTheme" parent="AppBaseTheme">
<item name="fontifyStyle">@style/CustomTextViewStyle</item>
</style>

c. In your layouts, use the Fontify subclass of your element as in (2) above, but omit the style attribute if you want the default font from the theme to apply

<!-- This element will use the default CustomTextViewStyle from AppTheme
since no specific style with the font attribute is specified -->
<com.danh32.fontify.TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>

####In layouts:
1) Add new XML NameSpace to root element of layout:

Expand Down
5 changes: 5 additions & 0 deletions Fontify/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@
<declare-styleable name="Fontify">
<attr name="font" format="string" />
</declare-styleable>

<!-- Allows attribute use in an AppTheme definition -->
<declare-styleable name="FontifyTheme">
<attr name="fontifyStyle" format="reference"/>
</declare-styleable>
</resources>
19 changes: 5 additions & 14 deletions Fontify/src/com/danh32/fontify/Button.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,29 @@


import android.content.Context;
import android.graphics.Paint;
import android.util.AttributeSet;


public class Button extends android.widget.Button {

public Button(Context context) {
super(context);
setup();
}

public Button(Context context, AttributeSet attrs) {
super(context, attrs);
setup();

// return early for eclipse preview mode
if (isInEditMode())
return;

if (isInEditMode()) return;

FontManager.getInstance().setFont(this, attrs);
}

public void setFont(String fontPath) {
FontManager.getInstance().setFont(this, fontPath);
}

public void setFont(int resId) {
String fontPath = getContext().getString(resId);
setFont(fontPath);
}

private void setup() {
setPaintFlags(getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.HINTING_ON);
}

}
19 changes: 5 additions & 14 deletions Fontify/src/com/danh32/fontify/CheckBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,29 @@


import android.content.Context;
import android.graphics.Paint;
import android.util.AttributeSet;


public class CheckBox extends android.widget.CheckBox {

public CheckBox(Context context) {
super(context);
setup();
}

public CheckBox(Context context, AttributeSet attrs) {
super(context, attrs);
setup();

// return early for eclipse preview mode
if (isInEditMode()) {
return;

}
if (isInEditMode()) return;

FontManager.getInstance().setFont(this, attrs);
}

public void setFont(String fontPath) {
FontManager.getInstance().setFont(this, fontPath);
}

public void setFont(int resId) {
String fontPath = getContext().getString(resId);
setFont(fontPath);
}

private void setup() {
setPaintFlags(getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.HINTING_ON);
}
}
Loading