Feature: Improve EKS, change server domain

This commit is contained in:
zt515
2017-06-17 12:38:23 +08:00
parent de522b9b19
commit 1bf540e5e5
11 changed files with 66 additions and 3 deletions

View File

@ -0,0 +1,21 @@
package io.neoterm;
import android.app.Application;
/**
* @author kiva
*/
public class NeoApp extends Application {
private static NeoApp app;
@Override
public void onCreate() {
super.onCreate();
app = this;
}
public static NeoApp get() {
return app;
}
}

View File

@ -0,0 +1,18 @@
package io.neoterm.customize.font
import android.graphics.Typeface
import io.neoterm.NeoApp
/**
* @author kiva
*/
object FontManager {
private var DEFAULT_FONT: Typeface? = null
fun getDefaultFont(): Typeface {
if (DEFAULT_FONT == null) {
DEFAULT_FONT = Typeface.createFromAsset(NeoApp.get().assets, "font.ttf")
}
return DEFAULT_FONT!!
}
}

View File

@ -135,7 +135,7 @@ public final class BaseFileInstaller {
private static URL determineZipUrl() throws MalformedURLException {
String archName = determineArchName();
return new URL("https://kernel19.cc/neoterm/boot/" + archName + ".zip");
return new URL("https://neoterm.kernel19.cc/boot/" + archName + ".zip");
}
public static String determineArchName() {

View File

@ -10,6 +10,7 @@ import android.os.Binder
import android.os.IBinder
import android.support.v4.content.WakefulBroadcastReceiver
import android.util.Log
import android.widget.Toast
import io.neoterm.R
import io.neoterm.backend.EmulatorDebug
import io.neoterm.backend.TerminalSession
@ -85,7 +86,8 @@ class NeoTermService : Service() {
NeoTermPath.USR_PATH + "/bin/" + NeoTermPreference.loadString(R.string.key_general_shell, "sh")
if (!File(executablePath).exists()) {
NeoTermPath.USR_PATH + "/bin/sh"
Toast.makeText(this, getString(R.string.shell_not_found, executablePath), Toast.LENGTH_LONG).show()
executablePath = NeoTermPath.USR_PATH + "/bin/sh"
}
}

View File

@ -8,6 +8,7 @@ import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.GridLayout;
import android.widget.Toast;
import android.widget.ToggleButton;
import java.io.File;
@ -17,6 +18,7 @@ import java.util.List;
import io.neoterm.R;
import io.neoterm.backend.TerminalSession;
import io.neoterm.customize.NeoTermPath;
import io.neoterm.customize.font.FontManager;
import io.neoterm.customize.shortcut.ShortcutConfig;
import io.neoterm.customize.shortcut.ShortcutConfigParser;
import io.neoterm.preference.NeoTermPreference;
@ -38,6 +40,11 @@ public final class ExtraKeysView extends GridLayout {
public static final ControlButton TAB = new ControlButton(KEY_TAB);
public static final StatedControlButton CTRL = new StatedControlButton(KEY_CTRL);
// public static final ControlButton ARROW_UP = new ControlButton("▲");
// public static final ControlButton ARROW_DOWN = new ControlButton("▼");
// public static final ControlButton ARROW_LEFT = new ControlButton("◀");
// public static final ControlButton ARROW_RIGHT = new ControlButton("▶");
public static final ControlButton ARROW_UP = new ControlButton("");
public static final ControlButton ARROW_DOWN = new ControlButton("");
public static final ControlButton ARROW_LEFT = new ControlButton("");
@ -169,6 +176,12 @@ public final class ExtraKeysView extends GridLayout {
button = new Button(getContext(), null, android.R.attr.buttonBarButtonStyle);
}
try {
button.setTypeface(FontManager.INSTANCE.getDefaultFont());
} catch (Throwable e) {
e.printStackTrace();
Toast.makeText(getContext(), e.getLocalizedMessage(), Toast.LENGTH_LONG).show();
}
button.setText(extraButton.buttonText);
button.setTextColor(NORMAL_TEXT_COLOR);
button.setAllCaps(false);