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

@ -8,6 +8,7 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:name=".NeoApp"
android:allowBackup="true"
android:extractNativeLibs="true"
android:icon="@mipmap/ic_launcher"

Binary file not shown.

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);

View File

@ -29,4 +29,5 @@
<string name="toggle_ime">切换输入法</string>
<string name="toggle_tab_switcher_menu_item">切换窗口</string>
<string name="ui_settings">界面设置</string>
<string name="shell_not_found">Shell %s 未找到, 请先安装.</string>
</resources>

View File

@ -10,7 +10,7 @@
<string name="key_ui_color_scheme" translatable="false">neoterm_ui_color_scheme</string>
<string name="key_ui_next_tab_anim" translatable="false">neoterm_ui_next_tab_anim</string>
<string name="key_ui_suggestions" translatable="false">neoterm_ui_suggestions</string>
<string name="key_ui_wide_char_weigh_explicit">neoterm_ui_wide_char_explicit</string>
<string name="key_ui_wide_char_weigh_explicit" translatable="false">neoterm_ui_wide_char_explicit</string>
<string name="key_package_source" translatable="false">neoterm_package_source</string>
</resources>

View File

@ -32,6 +32,7 @@
<string name="pref_ui_wide_char_weight_explicit_desc">If suggestion bar show incorrect, please enable this</string>
<string name="pref_package_source">Source</string>
<string name="toggle_ime">Toggle IME</string>
<string name="shell_not_found">Shell %s not found, please install it first.</string>
<string-array name="pref_ui_color_scheme_entries" translatable="false">
<item>Default</item>

View File

@ -19,4 +19,10 @@ class ExampleUnitTest {
parser.setInput(File("docs/shortcut-key-config.example"))
val config = parser.parse()
}
@Test
fun test_wchar() {
println("".length)
println("X".length)
}
}