Font Replacer


Source link: https://github.com/sylversky/fontreplacer

#Font Replacer

Change all text in your android application with selected font

Usage

Add on your project level build.gradle repositories: (this is optional, already available on jcenter)

allprojects {

  repositories {

...

maven {

 url 'https://dl.bintray.com/sylversky/AndroidLibrary/'

}

  
}
 
}
 

Add on your app level build.gradle dependencies:

dependencies{
 compile 'com.sylversky.fontreplacer:fontreplacer:1.0' 
}
 

Put your font (.ttf) file in assets folder.

On your Application class, add this line inside onCreate():

public class MyApplication extends Application {
 @Override public void onCreate() {

 super.onCreate();

 Replacer replacer = FontReplacer.Build(getApplicationContext());

 replacer.setDefaultFont("myfont.ttf");

 replacer.setBoldFont("myfont-bold.ttf");

 ...
 replacer.setThinFont("myfont-thin.ttf");

 replacer.setLightFont("myfont-light.ttf");

 ...
 replacer.applyFont();
 
}
 
}
 

On xml layout, change the font family properties with "sans-serif" to use selected light/medium/thin font:

<TextView
 android:id="@+id/text"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:textStyle="bold"
 android:text="This is medium bold font"
 android:fontFamily="sans-serif-medium" /> 

If you want to use your default font to another code, just use:

Typeface font = FontReplacer.getDefaultFont();
 yourview.setTypeface(font);
 

Resources

A simple progress animation, inspired by the Uber app.

Composition over inheritance

Allows to add functionality into an Android Activity. Just because we all have a BaseActivity in our projects containing too much unused stuff. When it grows, it get unmaintainable.

Convert between RxJava and Agera reactive base types.

Simple Android SharedPreferences wrapper.

IntelliJ plugin for supporting PermissionsDispatcher.

PermissionsDispatcher is wonderful library for Runtime Permissions. However, it asks developers "attach annotations" and "delegate to generated class" and then after that "rebuild". It's hard to follow all steps correctly. This plugin generates the skeleton of methods for "attach annotations" and "delegate to generated class" using GUI.

RecyclerViewHelper provides the most common functions around recycler view like Swipe to dismiss, Drag and Drop, Divider in the ui, events for when item selected and when not selected, on-click listener for items.

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