Giter Site home page Giter Site logo

androidfontsmanager's Introduction

FontsManager

字体管理器,方便快速的为应用内所有组件更换字体。

作者微博: @安卓攻城师sloop

使用文档

初始化

	FontsManager.init(typeface);                     //传入一个typeface初始化
	FontsManager.initFormAssets(context, fontPath);  //传入上下文和字体包路径(字体文件在Assets中)
	FontsManager.initFormFile(fontFile);             //传入一个字体包文件
	FontsManager.initFormFile(fontFilePath);         //传入一个字体包文件路径

改变一个activity的字体

	FontsManager.changeFonts(activity);

改变一个view的字体

	FontsManager.changeFonts(view);

改变一个ViewGroup的字体

	FontsManager.changeFonts(viewGroup);

示例

@Override
protected void onCreate(Bundle savedInstanceState){
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);
	FontsManager.initFormAssets(this, "fonts/sao.ttf");	//初始化
	FontsManager.changeFonts(this);		                //进行替换
}

Demo演示

fontsmanagerpic

androidfontsmanager's People

Contributors

gcssloop avatar

Watchers

James Cloos avatar liyong 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.