update fileName
This commit is contained in:
parent
08cc6cd293
commit
fcc016d81c
@ -28,6 +28,7 @@ import android.text.Html;
|
|||||||
import android.text.Layout;
|
import android.text.Layout;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.ViewTreeObserver;
|
import android.view.ViewTreeObserver;
|
||||||
@ -258,6 +259,7 @@ public class TextNode extends ViewNode<TextView> {
|
|||||||
}
|
}
|
||||||
} else if (prop.isObject()) {
|
} else if (prop.isObject()) {
|
||||||
final JSObject resource = prop.asObject();
|
final JSObject resource = prop.asObject();
|
||||||
|
final String identifier = resource.getProperty("identifier").asString().value();
|
||||||
final DoricResource doricResource = getDoricContext().getDriver().getRegistry().getResourceManager()
|
final DoricResource doricResource = getDoricContext().getDriver().getRegistry().getResourceManager()
|
||||||
.load(getDoricContext(), resource);
|
.load(getDoricContext(), resource);
|
||||||
if (doricResource != null) {
|
if (doricResource != null) {
|
||||||
@ -271,7 +273,7 @@ public class TextNode extends ViewNode<TextView> {
|
|||||||
} else {
|
} else {
|
||||||
filePath = getContext().getFilesDir().getPath() + "/customFonts";
|
filePath = getContext().getFilesDir().getPath() + "/customFonts";
|
||||||
}
|
}
|
||||||
File file = createFile(fontData, filePath, "tempFont.ttf");
|
File file = createFile(fontData, filePath, (identifier == null) ? "tempFont.ttf" : identifier);
|
||||||
Typeface customFont = Typeface.createFromFile(file);
|
Typeface customFont = Typeface.createFromFile(file);
|
||||||
view.setTypeface(customFont);
|
view.setTypeface(customFont);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -461,6 +463,7 @@ public class TextNode extends ViewNode<TextView> {
|
|||||||
if(!dir.exists()&&dir.isDirectory()){ // 判断文件目录是否存在
|
if(!dir.exists()&&dir.isDirectory()){ // 判断文件目录是否存在
|
||||||
dir.mkdirs();
|
dir.mkdirs();
|
||||||
}
|
}
|
||||||
|
Log.d("font", fileName);
|
||||||
file = new File(filePath+"\\"+fileName);
|
file = new File(filePath+"\\"+fileName);
|
||||||
fos = new FileOutputStream(file);
|
fos = new FileOutputStream(file);
|
||||||
bos = new BufferedOutputStream(fos);
|
bos = new BufferedOutputStream(fos);
|
||||||
|
Reference in New Issue
Block a user