有待重构
作者微博: @GcsSloop
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
dependencies {
compile 'com.github.GcsSloop:FontsManager:v1.0.0'
}
PS: 初始化方式任选其一即可,并且初始化函数只需要调用一次。
FontsManager.init(typeface); //传入一个typeface初始化
FontsManager.initFormAssets(context, fontPath); //传入上下文和字体包路径(字体文件在Assets中)
FontsManager.initFormFile(fontFile); //传入一个字体包文件
FontsManager.initFormFile(fontFilePath); //传入一个字体包文件路径
FontsManager.changeFonts(activity);
FontsManager.changeFonts(view);
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); //进行替换
}
版本号 | 更新内容 |
---|---|
v1.0.0 | 从 Bintray 迁移到 JitPack。 |
作者微博: @GcsSloop
Copyright (c) 2015 GcsSloop
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.