mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-11-25 19:51:10 +01:00
TerminalView: Make theming work for non-activities
This commit is contained in:
parent
b0f4efb0bc
commit
f153a72592
1 changed files with 4 additions and 4 deletions
|
|
@ -717,10 +717,10 @@ public final class TerminalView extends View {
|
|||
@Override
|
||||
public void run() {
|
||||
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;
|
||||
if (newTypeface != mRenderer.mTypeface) {
|
||||
((Activity) getContext()).runOnUiThread(new Runnable() {
|
||||
post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
|
@ -745,14 +745,14 @@ public final class TerminalView extends View {
|
|||
@Override
|
||||
public void run() {
|
||||
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;
|
||||
if (props != null) {
|
||||
try (InputStream in = new FileInputStream(colorsFile)) {
|
||||
props.load(in);
|
||||
}
|
||||
}
|
||||
((Activity) getContext()).runOnUiThread(new Runnable() {
|
||||
post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue