Git Product home page Git Product logo

magicviews's Introduction

MagicViews

Maven Central

Provides a simple way to set custom font in Android application. But, this is just a beginning. A lot of cool and awesome stuff is coming soon in this library.

ScreenshotsScreenshots

Usage

  1. Add the library as a dependency to your build.gradle
compile 'com.ivankocijan:MagicViews:version@aar'
  1. Add your application namespace to the root element in the XML xmlns:app="http://schemas.android.com/apk/res-auto"

  2. Specify path to fonts folder in onCreate method of your Application class (See example app).

   public class MyApplication extends Application {
   
        @Override
        public void onCreate() {
            super.onCreate();
            
             MagicViews.setFontFolderPath(this, "fontFolderPath");
        
        }
   
   }
   
  1. Instead of TextView use com.ivankocijan.magicviews.views.MagicTextView
    <com.ivankocijan.magicviews.views.MagicTextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:typeFace="cha_chicle.otf"/>

Supported views

  • TextView
  • EditText
  • Button
  • CheckBox
  • CheckedTextView
  • PreferenceGroup
  • Preference
  • CheckboxPreference
  • SwitchPreference
  • EditTextPreference

Supported Android versions

  • 2.3 or higher

Change log

V2.0.1

  • Removed static reference to context in MagicFont.java

V2.0.0

  • Support for adding font folder path - Going through all assets to find appropriate font was too slow on some phones so as of this version you need to initialize MagicViews by telling the library where fonts will be located. You can do it by calling MagicViews.setFontFolderPath(Context ctx, String fontFolderPath) in onCreate method of your application class. This approach works approximately 70% faster.
  • Support for Android L - The library no longer clashes with new v7 and v4 libraries

Contributing

Feedback and code contributions are very much welcomed. Just make a pull request with a short description of your changes. By making contributions to this project you give permission for your code to be used under the same license.

magicviews's People

Contributors

ikocijan avatar reisub avatar zzz6519003 avatar

Watchers

william avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.