You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
2.3 KiB
80 lines
2.3 KiB
/*
|
|
* This file is part of FYReader.
|
|
* FYReader is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* FYReader is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with FYReader. If not, see <https://www.gnu.org/licenses/>.
|
|
*
|
|
* Copyright (C) 2020 - 2022 fengyuecanzhu
|
|
*/
|
|
|
|
package com.kongzue.dialogx.util;
|
|
|
|
/**
|
|
* Author: @Kongzue
|
|
* Github: https://github.com/kongzue/
|
|
* Homepage: http://kongzue.com/
|
|
* Mail: myzcxhh@live.cn
|
|
* CreateTime: 2018/11/10 22:01
|
|
*/
|
|
public class TextInfo {
|
|
|
|
private int fontSize = -1; //字号大小,值为-1时使用默认样式,单位:dp
|
|
private int gravity = -1; //对齐方式,值为-1时使用默认样式,取值可使用Gravity.CENTER等对齐方式
|
|
private int fontColor = 1; //文字颜色,值为1时使用默认样式,取值可以用Color.rgb(r,g,b)等方式获取
|
|
private boolean bold = false; //是否粗体
|
|
|
|
public int getFontSize() {
|
|
return fontSize;
|
|
}
|
|
|
|
public TextInfo setFontSize(int fontSize) {
|
|
this.fontSize = fontSize;
|
|
return this;
|
|
}
|
|
|
|
public int getGravity() {
|
|
return gravity;
|
|
}
|
|
|
|
public TextInfo setGravity(int gravity) {
|
|
this.gravity = gravity;
|
|
return this;
|
|
}
|
|
|
|
public int getFontColor() {
|
|
return fontColor;
|
|
}
|
|
|
|
public TextInfo setFontColor(int fontColor) {
|
|
this.fontColor = fontColor;
|
|
return this;
|
|
}
|
|
|
|
public boolean isBold() {
|
|
return bold;
|
|
}
|
|
|
|
public TextInfo setBold(boolean bold) {
|
|
this.bold = bold;
|
|
return this;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "TextInfo{" +
|
|
"fontSize=" + fontSize +
|
|
", gravity=" + gravity +
|
|
", fontColor=" + fontColor +
|
|
", bold=" + bold +
|
|
'}';
|
|
}
|
|
}
|
|
|