mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-07 19:14:04 +08:00
TerminalView: Make theming work for non-activities
This commit is contained in:
@@ -717,10 +717,10 @@ public final class TerminalView extends View {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
File fontFile = new File(getContext().getFilesDir().getPath() + "/home/.termux/font.ttf");
|
File fontFile = new File("/data/data/com.termux/files/home/.termux/font.ttf");
|
||||||
final Typeface newTypeface = fontFile.exists() ? Typeface.createFromFile(fontFile) : Typeface.MONOSPACE;
|
final Typeface newTypeface = fontFile.exists() ? Typeface.createFromFile(fontFile) : Typeface.MONOSPACE;
|
||||||
if (newTypeface != mRenderer.mTypeface) {
|
if (newTypeface != mRenderer.mTypeface) {
|
||||||
((Activity) getContext()).runOnUiThread(new Runnable() {
|
post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
@@ -745,14 +745,14 @@ public final class TerminalView extends View {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
File colorsFile = new File(getContext().getFilesDir().getPath() + "/home/.termux/colors.properties");
|
File colorsFile = new File("/data/data/com.termux/files/home/.termux/colors.properties");
|
||||||
final Properties props = colorsFile.isFile() ? new Properties() : null;
|
final Properties props = colorsFile.isFile() ? new Properties() : null;
|
||||||
if (props != null) {
|
if (props != null) {
|
||||||
try (InputStream in = new FileInputStream(colorsFile)) {
|
try (InputStream in = new FileInputStream(colorsFile)) {
|
||||||
props.load(in);
|
props.load(in);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
((Activity) getContext()).runOnUiThread(new Runnable() {
|
post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user