MagicViews


Source link: https://github.com/ikocijan/MagicViews

MagicViews

Provides a simple way to set custom font in Android application.

Adding to your project

  1. Add the library as a dependency to your build.gradle
compile 'com.ivankocijan:MagicViews:version@aar'
  1. 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");

}

  
}

 

Usage from layout

  1. Add your application namespace to the root element in the XML xmlns:app=" http://schemas.android.com/apk/res-auto"

  2. 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"/>

For a complete list of features and how to use them see wiki page.

Supported views

  • TextView
  • EditText
  • Button
  • CheckBox
  • CheckedTextView
  • RadioButton
  • AutoCompleteTextView
  • MultiAutoCompleteTextView
  • PreferenceGroup
  • Preference
  • CheckboxPreference
  • SwitchPreference
  • EditTextPreference
  • Span

Supported Android versions

  • 2.3 or higher

Change log

V3.1.0

V3.0.1

  • New letter spacing attribute which lets you add horizonatal spacing between characters
  • TabLayout support - you can now set custom font on TabLayout

See wiki for more info.

You might encounter this issue after updating: /build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/res/values-v23/values-v23.xml

There are two options to fix that:

Exclude appcompact-v7 from MagicViews library:

 compile('com.ivankocijan:MagicViews:3.1.0@aar') {

exclude group: 'com.android.support', module: 'appcompat-v7'
  
}

or Compile your app with Android SDK 23:

android {

 compileSdkVersion 23
 
}

V3.0

  • Library now uses new AppCompat views which backport some cool stuff to pre-lollipop devices. See Android developer blogspot for more info
  • Added new views: RadioButton, AutoCompleteTextView and MultiAutoCompleteTextView
  • Font can now be set from code by calling setFont(String fontName) method
  • Example app is updated with new features
  • Bugfixes

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.

Resources

Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstalling apk.

Fast and efficient selector of albums with low memory usage.

A wheel-style fragment selection control.

A fast, flexible, powerful ImageView that supports rounded corners, circles and polygons.

ViewPager with vertical sliding effects and activity transition.

OptionsPickerView like in iOS.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes