UI: Customization Activity
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
|
||||
<application
|
||||
android:name=".App"
|
||||
android:allowBackup="true"
|
||||
android:extractNativeLibs="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
@ -27,9 +28,15 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".ui.pm.PackageManagerActivity"
|
||||
<activity
|
||||
android:name=".ui.pm.PackageManagerActivity"
|
||||
android:label="@string/package_settings"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name=".ui.customization.CustomizationActivity"
|
||||
android:label="@string/pref_ui_customization"
|
||||
android:theme="@style/Theme.AppCompat.NoActionBar"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden" />
|
||||
<activity
|
||||
android:name=".ui.settings.SettingActivity"
|
||||
android:theme="@style/Theme.AppCompat" />
|
||||
|
16
app/src/main/java/io/neoterm/App.kt
Normal file
16
app/src/main/java/io/neoterm/App.kt
Normal file
@ -0,0 +1,16 @@
|
||||
package io.neoterm
|
||||
|
||||
import android.app.Application
|
||||
import io.neoterm.customize.font.FontManager
|
||||
import io.neoterm.preference.NeoPreference
|
||||
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
class App : Application() {
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
FontManager.init(this)
|
||||
NeoPreference.init(this)
|
||||
}
|
||||
}
|
@ -24,7 +24,11 @@ public final class TerminalColors {
|
||||
|
||||
/** Reset all indexed colors with the default color from the color theme. */
|
||||
public void reset() {
|
||||
System.arraycopy(COLOR_SCHEME.mDefaultColors, 0, mCurrentColors, 0, TextStyle.NUM_INDEXED_COLORS);
|
||||
reset(COLOR_SCHEME);
|
||||
}
|
||||
|
||||
public void reset(TerminalColorScheme colorScheme) {
|
||||
System.arraycopy(colorScheme.mDefaultColors, 0, mCurrentColors, 0, TextStyle.NUM_INDEXED_COLORS);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,18 @@
|
||||
package io.neoterm.customize.color
|
||||
|
||||
import io.neoterm.backend.TerminalEmulator
|
||||
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
object ColorSchemeManager {
|
||||
fun applyColorScheme(emulator: TerminalEmulator?, colorScheme: NeoColorScheme?) {
|
||||
if (emulator != null && colorScheme != null) {
|
||||
colorScheme.applyLocal(emulator)
|
||||
}
|
||||
}
|
||||
|
||||
fun applyGlobalColorScheme(colorScheme: NeoColorScheme?) {
|
||||
colorScheme?.applyGlobal()
|
||||
}
|
||||
}
|
@ -1,17 +1,25 @@
|
||||
package io.neoterm.customize.color
|
||||
|
||||
import io.neoterm.backend.TerminalColorScheme
|
||||
import io.neoterm.backend.TerminalColors
|
||||
import io.neoterm.backend.TerminalEmulator
|
||||
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
open class NeoTermColorScheme {
|
||||
open class NeoColorScheme {
|
||||
var foreground: String? = null
|
||||
var background: String? = null
|
||||
var cursor: String? = null
|
||||
var color: MutableMap<Int, String> = mutableMapOf()
|
||||
|
||||
fun apply() {
|
||||
fun applyGlobal() {
|
||||
TerminalColors.COLOR_SCHEME.updateWith(foreground, background, cursor, color)
|
||||
}
|
||||
|
||||
fun applyLocal(emulator: TerminalEmulator) {
|
||||
val scheme = TerminalColorScheme()
|
||||
scheme.updateWith(foreground, background, cursor, color)
|
||||
emulator.mColors.reset(scheme)
|
||||
}
|
||||
}
|
@ -1,11 +1,11 @@
|
||||
package io.neoterm.customize.color.builtin
|
||||
|
||||
import io.neoterm.customize.color.NeoTermColorScheme
|
||||
import io.neoterm.customize.color.NeoColorScheme
|
||||
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
class MaterialColorScheme : NeoTermColorScheme() {
|
||||
class MaterialColorScheme : NeoColorScheme() {
|
||||
init {
|
||||
foreground = "#263238"
|
||||
background = "#263238"
|
||||
|
@ -7,17 +7,19 @@ import android.graphics.Typeface
|
||||
* @author kiva
|
||||
*/
|
||||
object FontManager {
|
||||
private lateinit var DEFAULT_FONT: Typeface
|
||||
private lateinit var DEFAULT_FONT: NeoFont
|
||||
private lateinit var fonts: MutableList<String>
|
||||
|
||||
fun init(context: Context) {
|
||||
DEFAULT_FONT = Typeface.createFromAsset(context.assets, "font.ttf")
|
||||
fonts = mutableListOf()
|
||||
DEFAULT_FONT = NeoFont(Typeface.createFromAsset(context.assets, "font.ttf"))
|
||||
}
|
||||
|
||||
fun getDefaultFont(): Typeface {
|
||||
fun getDefaultFont(): NeoFont {
|
||||
return DEFAULT_FONT
|
||||
}
|
||||
|
||||
fun getCurrentFont(): Typeface {
|
||||
return DEFAULT_FONT
|
||||
fun getCurrentFont(): NeoFont {
|
||||
return getDefaultFont()
|
||||
}
|
||||
}
|
13
app/src/main/java/io/neoterm/customize/font/NeoFont.kt
Normal file
13
app/src/main/java/io/neoterm/customize/font/NeoFont.kt
Normal file
@ -0,0 +1,13 @@
|
||||
package io.neoterm.customize.font
|
||||
|
||||
import android.graphics.Typeface
|
||||
import io.neoterm.view.TerminalView
|
||||
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
class NeoFont(val typeface: Typeface) {
|
||||
fun applyLocal(terminalView: TerminalView?) {
|
||||
terminalView?.setTypeface(typeface)
|
||||
}
|
||||
}
|
@ -19,7 +19,6 @@ import android.widget.ImageButton
|
||||
import de.mrapp.android.tabswitcher.*
|
||||
import io.neoterm.R
|
||||
import io.neoterm.backend.TerminalSession
|
||||
import io.neoterm.customize.font.FontManager
|
||||
import io.neoterm.customize.eks.EksConfigLoader
|
||||
import io.neoterm.customize.eks.builtin.BuiltinEksKeys
|
||||
import io.neoterm.customize.setup.BaseFileInstaller
|
||||
@ -52,8 +51,6 @@ class NeoTermActivity : AppCompatActivity(), ServiceConnection, SharedPreference
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
NeoPermission.initAppPermission(this, NeoPermission.REQUEST_APP_PERMISSION)
|
||||
FontManager.init(this)
|
||||
NeoPreference.init(this)
|
||||
|
||||
val fullscreen = NeoPreference.loadBoolean(R.string.key_ui_fullscreen, false)
|
||||
if (fullscreen) {
|
||||
|
@ -0,0 +1,51 @@
|
||||
package io.neoterm.ui.customization
|
||||
|
||||
import android.os.Bundle
|
||||
import android.support.v7.app.AppCompatActivity
|
||||
import android.support.v7.widget.Toolbar
|
||||
import android.view.MenuItem
|
||||
import io.neoterm.R
|
||||
import io.neoterm.backend.TerminalSession
|
||||
import io.neoterm.customize.NeoTermPath
|
||||
import io.neoterm.utils.TerminalUtils
|
||||
import io.neoterm.view.BasicSessionCallback
|
||||
import io.neoterm.view.BasicViewClient
|
||||
import io.neoterm.view.TerminalView
|
||||
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
class CustomizationActivity: AppCompatActivity() {
|
||||
lateinit var terminalView: TerminalView
|
||||
lateinit var viewClient: BasicViewClient
|
||||
lateinit var sessionCallback: BasicSessionCallback
|
||||
lateinit var session: TerminalSession
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.ui_customization)
|
||||
val toolbar = findViewById(R.id.custom_toolbar) as Toolbar
|
||||
setSupportActionBar(toolbar)
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
|
||||
terminalView = findViewById(R.id.terminal_view) as TerminalView
|
||||
viewClient = BasicViewClient(terminalView)
|
||||
sessionCallback = BasicSessionCallback(terminalView)
|
||||
TerminalUtils.setupTerminalView(terminalView, viewClient)
|
||||
session = TerminalUtils.createSession(this, "${NeoTermPath.USR_PATH}/bin/applets/echo",
|
||||
arrayOf("echo", "Hello NeoTerm."), null, null, sessionCallback, false)
|
||||
terminalView.attachSession(session)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
session.finishIfRunning()
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
|
||||
when (item?.itemId) {
|
||||
android.R.id.home -> finish()
|
||||
}
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
}
|
@ -5,13 +5,24 @@ import android.widget.Toast
|
||||
import io.neoterm.R
|
||||
import io.neoterm.backend.TerminalSession
|
||||
import io.neoterm.customize.NeoTermPath
|
||||
import io.neoterm.customize.font.FontManager
|
||||
import io.neoterm.preference.NeoPreference
|
||||
import io.neoterm.view.BasicViewClient
|
||||
import io.neoterm.view.TerminalView
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
object TerminalUtils {
|
||||
fun setupTerminalView(terminalView: TerminalView, terminalViewClient: BasicViewClient? = null) {
|
||||
terminalView.textSize = NeoPreference.loadInt(NeoPreference.KEY_FONT_SIZE, 30)
|
||||
terminalView.setTypeface(FontManager.getCurrentFont().typeface)
|
||||
if (terminalViewClient != null) {
|
||||
terminalView.setOnKeyListener(terminalViewClient)
|
||||
}
|
||||
}
|
||||
|
||||
fun createSession(context: Context, executablePath: String?, arguments: Array<String>?, cwd: String?, env: Array<String>?, sessionCallback: TerminalSession.SessionChangedCallback?, systemShell: Boolean): TerminalSession {
|
||||
var executablePath = executablePath
|
||||
var arguments = arguments
|
||||
|
29
app/src/main/java/io/neoterm/view/BasicSessionCallback.kt
Normal file
29
app/src/main/java/io/neoterm/view/BasicSessionCallback.kt
Normal file
@ -0,0 +1,29 @@
|
||||
package io.neoterm.view
|
||||
|
||||
import io.neoterm.backend.TerminalSession
|
||||
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
class BasicSessionCallback(var terminalView: TerminalView) : TerminalSession.SessionChangedCallback {
|
||||
override fun onTextChanged(changedSession: TerminalSession?) {
|
||||
if (changedSession != null) {
|
||||
terminalView.onScreenUpdated()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTitleChanged(changedSession: TerminalSession?) {
|
||||
}
|
||||
|
||||
override fun onSessionFinished(finishedSession: TerminalSession?) {
|
||||
}
|
||||
|
||||
override fun onClipboardText(session: TerminalSession?, text: String?) {
|
||||
}
|
||||
|
||||
override fun onBell(session: TerminalSession?) {
|
||||
}
|
||||
|
||||
override fun onColorsChanged(session: TerminalSession?) {
|
||||
}
|
||||
}
|
55
app/src/main/java/io/neoterm/view/BasicViewClient.kt
Normal file
55
app/src/main/java/io/neoterm/view/BasicViewClient.kt
Normal file
@ -0,0 +1,55 @@
|
||||
package io.neoterm.view
|
||||
|
||||
import android.view.KeyEvent
|
||||
import android.view.MotionEvent
|
||||
import io.neoterm.backend.TerminalSession
|
||||
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
class BasicViewClient(val terminalView: TerminalView) : TerminalViewClient {
|
||||
override fun onScale(scale: Float): Float {
|
||||
if (scale < 0.9f || scale > 1.1f) {
|
||||
val increase = scale > 1f
|
||||
val changedSize = (if (increase) 1 else -1) * 2
|
||||
val fontSize = terminalView.textSize + changedSize
|
||||
terminalView.textSize = fontSize
|
||||
return 1.0f
|
||||
}
|
||||
return scale
|
||||
}
|
||||
|
||||
override fun onSingleTapUp(e: MotionEvent?) {
|
||||
}
|
||||
|
||||
override fun shouldBackButtonBeMappedToEscape(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun copyModeChanged(copyMode: Boolean) {
|
||||
}
|
||||
|
||||
override fun onKeyDown(keyCode: Int, e: KeyEvent?, session: TerminalSession?): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onKeyUp(keyCode: Int, e: KeyEvent?): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun readControlKey(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun readAltKey(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onCodePoint(codePoint: Int, ctrlDown: Boolean, session: TerminalSession?): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onLongPress(event: MotionEvent?): Boolean {
|
||||
return false
|
||||
}
|
||||
}
|
@ -185,7 +185,7 @@ public final class ExtraKeysView extends LinearLayout {
|
||||
button = new Button(getContext(), null, android.R.attr.buttonBarButtonStyle);
|
||||
}
|
||||
|
||||
button.setTypeface(FontManager.INSTANCE.getDefaultFont());
|
||||
button.setTypeface(FontManager.INSTANCE.getCurrentFont().getTypeface());
|
||||
button.setText(extraButton.buttonText);
|
||||
button.setTextColor(NORMAL_TEXT_COLOR);
|
||||
button.setAllCaps(false);
|
||||
|
@ -1,104 +1,35 @@
|
||||
package io.neoterm.view
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
import android.content.DialogInterface
|
||||
import android.graphics.Typeface
|
||||
import android.view.KeyEvent
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import io.neoterm.R
|
||||
import io.neoterm.backend.TerminalSession
|
||||
import io.neoterm.preference.NeoPreference
|
||||
import io.neoterm.utils.TerminalUtils
|
||||
import io.neoterm.view.TerminalView
|
||||
import io.neoterm.view.TerminalViewClient
|
||||
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
class TerminalDialog(val context: Context, var cancelListener: DialogInterface.OnCancelListener?) {
|
||||
class MinimalViewClient : TerminalViewClient {
|
||||
override fun onScale(scale: Float): Float {
|
||||
return scale
|
||||
}
|
||||
|
||||
override fun onSingleTapUp(e: MotionEvent?) {
|
||||
}
|
||||
|
||||
override fun shouldBackButtonBeMappedToEscape(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun copyModeChanged(copyMode: Boolean) {
|
||||
}
|
||||
|
||||
override fun onKeyDown(keyCode: Int, e: KeyEvent?, session: TerminalSession?): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onKeyUp(keyCode: Int, e: KeyEvent?): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun readControlKey(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun readAltKey(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onCodePoint(codePoint: Int, ctrlDown: Boolean, session: TerminalSession?): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onLongPress(event: MotionEvent?): Boolean {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
class MinimalSessionCallback(var terminalView: TerminalView) : TerminalSession.SessionChangedCallback {
|
||||
override fun onTextChanged(changedSession: TerminalSession?) {
|
||||
if (changedSession != null) {
|
||||
terminalView.onScreenUpdated()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTitleChanged(changedSession: TerminalSession?) {
|
||||
}
|
||||
|
||||
override fun onSessionFinished(finishedSession: TerminalSession?) {
|
||||
}
|
||||
|
||||
override fun onClipboardText(session: TerminalSession?, text: String?) {
|
||||
}
|
||||
|
||||
override fun onBell(session: TerminalSession?) {
|
||||
}
|
||||
|
||||
override fun onColorsChanged(session: TerminalSession?) {
|
||||
}
|
||||
}
|
||||
|
||||
var view: View
|
||||
@SuppressLint("InflateParams")
|
||||
var view: View = LayoutInflater.from(context).inflate(R.layout.ui_term_dialog, null, false)
|
||||
var terminalView: TerminalView
|
||||
var terminalViewClient: MinimalViewClient
|
||||
var terminalSessionCallback: MinimalSessionCallback
|
||||
var terminalViewClient: BasicViewClient
|
||||
var terminalSessionCallback: BasicSessionCallback
|
||||
var dialog: AlertDialog? = null
|
||||
var terminalSession: TerminalSession? = null
|
||||
|
||||
init {
|
||||
view = LayoutInflater.from(context).inflate(R.layout.ui_term_dialog, null, false)
|
||||
|
||||
terminalView = view.findViewById(R.id.terminal_view_dialog) as TerminalView
|
||||
terminalView.textSize = NeoPreference.loadInt(NeoPreference.KEY_FONT_SIZE, 30)
|
||||
terminalView.setTypeface(Typeface.MONOSPACE)
|
||||
terminalViewClient = BasicViewClient(terminalView)
|
||||
TerminalUtils.setupTerminalView(terminalView, terminalViewClient)
|
||||
|
||||
terminalViewClient = MinimalViewClient()
|
||||
terminalView.setOnKeyListener(terminalViewClient)
|
||||
terminalSessionCallback = MinimalSessionCallback(terminalView)
|
||||
terminalSessionCallback = BasicSessionCallback(terminalView)
|
||||
}
|
||||
|
||||
fun execute(executablePath: String, arguments: Array<String>?) {
|
||||
|
@ -7,7 +7,8 @@ import android.view.inputmethod.InputMethodManager
|
||||
import de.mrapp.android.tabswitcher.Tab
|
||||
import io.neoterm.R
|
||||
import io.neoterm.backend.TerminalSession
|
||||
import io.neoterm.customize.color.NeoTermColorScheme
|
||||
import io.neoterm.customize.color.ColorSchemeManager
|
||||
import io.neoterm.customize.color.NeoColorScheme
|
||||
import io.neoterm.preference.NeoPreference
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
|
||||
@ -21,8 +22,8 @@ class TermTab(title: CharSequence) : Tab(title) {
|
||||
var viewClient: TermViewClient? = null
|
||||
var toolbar: Toolbar? = null
|
||||
|
||||
fun changeColorScheme(colorScheme: NeoTermColorScheme?) {
|
||||
colorScheme?.apply()
|
||||
fun changeColorScheme(colorScheme: NeoColorScheme?) {
|
||||
ColorSchemeManager.applyColorScheme(termSession?.emulator, colorScheme)
|
||||
viewClient?.extraKeysView?.setBackgroundColor(Color.parseColor(colorScheme?.background))
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
package io.neoterm.view.tab
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Typeface
|
||||
import android.os.Bundle
|
||||
import android.support.v7.widget.Toolbar
|
||||
import android.view.LayoutInflater
|
||||
@ -12,9 +11,9 @@ import de.mrapp.android.tabswitcher.Tab
|
||||
import de.mrapp.android.tabswitcher.TabSwitcher
|
||||
import de.mrapp.android.tabswitcher.TabSwitcherDecorator
|
||||
import io.neoterm.R
|
||||
import io.neoterm.customize.font.FontManager
|
||||
import io.neoterm.preference.NeoPreference
|
||||
import io.neoterm.ui.NeoTermActivity
|
||||
import io.neoterm.utils.TerminalUtils
|
||||
import io.neoterm.view.ExtraKeysView
|
||||
import io.neoterm.view.TerminalView
|
||||
|
||||
@ -69,8 +68,7 @@ class TermTabDecorator(val context: NeoTermActivity) : TabSwitcherDecorator() {
|
||||
if (view == null) {
|
||||
return
|
||||
}
|
||||
view.textSize = NeoPreference.loadInt(NeoPreference.KEY_FONT_SIZE, 30)
|
||||
view.setTypeface(FontManager.getCurrentFont())
|
||||
TerminalUtils.setupTerminalView(view)
|
||||
context.fullScreenToggleButton.setStatus(NeoPreference.loadBoolean(R.string.key_ui_fullscreen, false))
|
||||
|
||||
if (tab is TermTab) {
|
||||
|
76
app/src/main/res/layout/ui_customization.xml
Normal file
76
app/src/main/res/layout/ui_customization.xml
Normal file
@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/custom_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/colorPrimaryDark"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark"
|
||||
android:visibility="visible"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Dark" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/custom_editor_layout"
|
||||
style="?buttonBarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_margin="@dimen/text_margin"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
style="?buttonBarButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.0"
|
||||
android:text="@string/pref_customization_font" />
|
||||
|
||||
<Button
|
||||
style="?buttonBarButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.0"
|
||||
android:text="@string/pref_customization_color_scheme" />
|
||||
|
||||
<Button
|
||||
style="?buttonBarButtonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.0"
|
||||
android:text="@string/pref_customization_eks" />
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@id/custom_editor_layout"
|
||||
android:layout_below="@id/custom_toolbar"
|
||||
android:layout_margin="@dimen/preview_layout_margin">
|
||||
|
||||
<io.neoterm.view.ExtraKeysView
|
||||
android:id="@+id/custom_extra_keys"
|
||||
style="?android:buttonBarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/eks_height_two_line"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/terminal_background"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<io.neoterm.view.TerminalView
|
||||
android:id="@+id/terminal_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@id/custom_extra_keys"
|
||||
android:background="@color/terminal_background"
|
||||
android:fadeScrollbars="true"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
@ -19,8 +19,8 @@
|
||||
<string name="pref_package_source">软件源</string>
|
||||
<string name="pref_ui_close_tab_anim_next_tab">向下切换窗口</string>
|
||||
<string name="pref_ui_close_tab_anim_next_tab_desc">关闭当前窗口时切换到下一个窗口而不是上一个</string>
|
||||
<string name="pref_ui_color_scheme">配色方案</string>
|
||||
<string name="pref_ui_font">字体</string>
|
||||
<string name="pref_ui_customization_desc">字体 & 主题 & 拓展键盘</string>
|
||||
<string name="pref_ui_customization">个性化</string>
|
||||
<string name="pref_ui_fullscreen">全屏</string>
|
||||
<string name="pref_ui_hide_toolbar">隐藏标题栏</string>
|
||||
<string name="pref_ui_hide_toolbar_desc">键盘显示时隐藏标题栏</string>
|
||||
@ -28,6 +28,8 @@
|
||||
<string name="pref_ui_suggestions_desc">使用一些软件时,屏幕下方显示快捷键</string>
|
||||
<string name="pref_ui_wide_char_weight_explicit">为宽字符设置权重</string>
|
||||
<string name="pref_ui_wide_char_weight_explicit_desc">如果快捷输入栏显示不正确,请勾选本项</string>
|
||||
<string name="pref_customization_color_scheme">配色方案</string>
|
||||
<string name="pref_customization_font">字体</string>
|
||||
<string name="settings">设置</string>
|
||||
<string name="text_selection_more">更多</string>
|
||||
<string name="toggle_ime">切换输入法</string>
|
||||
@ -60,4 +62,5 @@
|
||||
<item>调试源 (可能不稳定)</item>
|
||||
<item>输入…</item>
|
||||
</string-array>
|
||||
<string name="pref_customization_eks">拓展键盘</string>
|
||||
</resources>
|
@ -2,6 +2,7 @@
|
||||
<dimen name="app_bar_height">180dp</dimen>
|
||||
<dimen name="fab_margin">16dp</dimen>
|
||||
<dimen name="text_margin">16dp</dimen>
|
||||
<dimen name="preview_layout_margin">32dp</dimen>
|
||||
<dimen name="eks_height">36dp</dimen>
|
||||
<dimen name="eks_height_two_line">72dp</dimen>
|
||||
<dimen name="eks_height_one_line">36dp</dimen>
|
||||
|
@ -26,17 +26,20 @@
|
||||
<string name="pref_general_shell_desc">Which shell should we use when login</string>
|
||||
<string name="pref_general_program_selection">Program Selection</string>
|
||||
<string name="pref_general_program_selection_desc">When both Neo Term and your Android OS have a program, which one should we choose?</string>
|
||||
<string name="pref_ui_customization_desc">Font & ColorScheme & ExtraKeys</string>
|
||||
<string name="pref_ui_customization">Customization</string>
|
||||
<string name="pref_ui_fullscreen">Full Screen</string>
|
||||
<string name="pref_ui_hide_toolbar">Hide Toolbar</string>
|
||||
<string name="pref_ui_hide_toolbar_desc">Hide toolbar when keyboard is showing</string>
|
||||
<string name="pref_ui_font">Font</string>
|
||||
<string name="pref_ui_color_scheme">Color Scheme</string>
|
||||
<string name="pref_ui_close_tab_anim_next_tab">Next tab animation</string>
|
||||
<string name="pref_ui_close_tab_anim_next_tab_desc">Switch to the next tab instead of the previous tab when closing tab</string>
|
||||
<string name="pref_ui_suggestions">Show Suggestions (oh-my-zsh required)</string>
|
||||
<string name="pref_ui_suggestions_desc">When using some programs, show shortcut keys</string>
|
||||
<string name="pref_ui_wide_char_weight_explicit">Use explicit weight for wide char</string>
|
||||
<string name="pref_ui_wide_char_weight_explicit_desc">If suggestion bar show incorrect, please enable this</string>
|
||||
<string name="pref_customization_font">Font</string>
|
||||
<string name="pref_customization_color_scheme">Color Scheme</string>
|
||||
<string name="pref_customization_eks">Extra Keys</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>
|
||||
@ -53,10 +56,6 @@
|
||||
<string name="menu_refresh_list">Refresh</string>
|
||||
<string name="menu_update">Update & Refresh</string>
|
||||
|
||||
<string-array name="pref_ui_color_scheme_entries" translatable="false">
|
||||
<item>Default</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pref_general_shell_entries" translatable="false">
|
||||
<item>sh</item>
|
||||
<item>zsh</item>
|
||||
|
@ -1,6 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<Preference
|
||||
android:summary="@string/pref_ui_customization_desc"
|
||||
android:title="@string/pref_ui_customization">
|
||||
<intent
|
||||
android:targetClass="io.neoterm.ui.customization.CustomizationActivity"
|
||||
android:targetPackage="io.neoterm" />
|
||||
</Preference>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="@string/key_ui_fullscreen"
|
||||
@ -29,15 +37,4 @@
|
||||
android:key="@string/key_ui_wide_char_weigh_explicit"
|
||||
android:summary="@string/pref_ui_wide_char_weight_explicit_desc"
|
||||
android:title="@string/pref_ui_wide_char_weight_explicit" />
|
||||
|
||||
<EditTextPreference
|
||||
android:key="@string/key_ui_font"
|
||||
android:title="@string/pref_ui_font" />
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="Default"
|
||||
android:entries="@array/pref_ui_color_scheme_entries"
|
||||
android:entryValues="@array/pref_ui_color_scheme_entries"
|
||||
android:key="@string/key_ui_color_scheme"
|
||||
android:title="@string/pref_ui_color_scheme" />
|
||||
</PreferenceScreen>
|
Reference in New Issue
Block a user