Merge branch 'master' of git.oschina.net:lody/neoterm
# Conflicts: # app/src/main/java/io/neoterm/view/tab/TermTab.kt
This commit is contained in:
commit
a15bb719df
@ -11,7 +11,7 @@
|
|||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
<activity
|
<activity
|
||||||
android:name=".NeoTermActivity"
|
android:name=".ui.NeoTermActivity"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustResize|stateAlwaysVisible">
|
android:windowSoftInputMode="adjustResize|stateAlwaysVisible">
|
||||||
@ -23,7 +23,7 @@
|
|||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".NeoTermService"
|
android:name=".services.NeoTermService"
|
||||||
android:enabled="true" />
|
android:enabled="true" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package io.neoterm.terminal;
|
package io.neoterm.backend;
|
||||||
|
|
||||||
/** A circular byte buffer allowing one producer and one consumer thread. */
|
/** A circular byte buffer allowing one producer and one consumer thread. */
|
||||||
final class ByteQueue {
|
final class ByteQueue {
|
@ -1,4 +1,4 @@
|
|||||||
package io.neoterm.terminal;
|
package io.neoterm.backend;
|
||||||
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package io.neoterm.terminal;
|
package io.neoterm.backend;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Native methods for creating and managing pseudoterminal subprocesses. C code is in jni/termux.c.
|
* Native methods for creating and managing pseudoterminal subprocesses. C code is in jni/termux.c.
|
@ -1,4 +1,4 @@
|
|||||||
package io.neoterm.terminal;
|
package io.neoterm.backend;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
@ -1,4 +1,4 @@
|
|||||||
package io.neoterm.terminal;
|
package io.neoterm.backend;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A circular buffer of {@link TerminalRow}:s which keeps notes about what is visible on a logical screen and the scroll
|
* A circular buffer of {@link TerminalRow}:s which keeps notes about what is visible on a logical screen and the scroll
|
@ -1,4 +1,4 @@
|
|||||||
package io.neoterm.terminal;
|
package io.neoterm.backend;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
@ -1,4 +1,4 @@
|
|||||||
package io.neoterm.terminal;
|
package io.neoterm.backend;
|
||||||
|
|
||||||
/** Current terminal colors (if different from default). */
|
/** Current terminal colors (if different from default). */
|
||||||
public final class TerminalColors {
|
public final class TerminalColors {
|
@ -1,4 +1,4 @@
|
|||||||
package io.neoterm.terminal;
|
package io.neoterm.backend;
|
||||||
|
|
||||||
import android.util.Base64;
|
import android.util.Base64;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
@ -1,4 +1,4 @@
|
|||||||
package io.neoterm.terminal;
|
package io.neoterm.backend;
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package io.neoterm.terminal;
|
package io.neoterm.backend;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package io.neoterm.terminal;
|
package io.neoterm.backend;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
@ -1,4 +1,4 @@
|
|||||||
package io.neoterm.terminal;
|
package io.neoterm.backend;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
@ -1,4 +1,4 @@
|
|||||||
package io.neoterm.terminal;
|
package io.neoterm.backend;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of wcwidth(3) for Unicode 9.
|
* Implementation of wcwidth(3) for Unicode 9.
|
@ -1,7 +1,7 @@
|
|||||||
package io.neoterm.customize
|
package io.neoterm.customize
|
||||||
|
|
||||||
import io.neoterm.terminal.TerminalColors
|
import io.neoterm.backend.TerminalColors
|
||||||
import io.neoterm.terminal.TerminalSession
|
import io.neoterm.backend.TerminalSession
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kiva
|
* @author kiva
|
@ -0,0 +1,7 @@
|
|||||||
|
package io.neoterm.customize.color.builtin
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kiva
|
||||||
|
*/
|
||||||
|
class MaterialColorScheme {
|
||||||
|
}
|
@ -2,10 +2,8 @@ package io.neoterm.preference
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.preference.PreferenceManager
|
import android.preference.PreferenceManager
|
||||||
|
import io.neoterm.backend.TerminalSession
|
||||||
import io.neoterm.NeoTermActivity
|
import io.neoterm.services.NeoTermService
|
||||||
import io.neoterm.NeoTermService
|
|
||||||
import io.neoterm.terminal.TerminalSession
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kiva
|
* @author kiva
|
||||||
@ -15,7 +13,10 @@ object NeoTermPreference {
|
|||||||
var CURRENT_SESSION_KEY = "neoterm_current_session"
|
var CURRENT_SESSION_KEY = "neoterm_current_session"
|
||||||
|
|
||||||
fun storeCurrentSession(context: Context, session: TerminalSession) {
|
fun storeCurrentSession(context: Context, session: TerminalSession) {
|
||||||
PreferenceManager.getDefaultSharedPreferences(context).edit().putString(NeoTermPreference.CURRENT_SESSION_KEY, session.mHandle).apply()
|
PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
|
.edit()
|
||||||
|
.putString(NeoTermPreference.CURRENT_SESSION_KEY, session.mHandle)
|
||||||
|
.apply()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getCurrentSession(termService: NeoTermService?): TerminalSession? {
|
fun getCurrentSession(termService: NeoTermService?): TerminalSession? {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package io.neoterm;
|
package io.neoterm.services;
|
||||||
|
|
||||||
import android.app.Notification;
|
import android.app.Notification;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
@ -15,8 +15,10 @@ import android.util.Log;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.neoterm.terminal.EmulatorDebug;
|
import io.neoterm.ui.NeoTermActivity;
|
||||||
import io.neoterm.terminal.TerminalSession;
|
import io.neoterm.R;
|
||||||
|
import io.neoterm.backend.EmulatorDebug;
|
||||||
|
import io.neoterm.backend.TerminalSession;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kiva
|
* @author kiva
|
||||||
@ -78,7 +80,7 @@ public class NeoTermService extends Service {
|
|||||||
return mTerminalSessions;
|
return mTerminalSessions;
|
||||||
}
|
}
|
||||||
|
|
||||||
TerminalSession createTermSession(String executablePath, String[] arguments, String cwd, String[] env, TerminalSession.SessionChangedCallback sessionCallback) {
|
public TerminalSession createTermSession(String executablePath, String[] arguments, String cwd, String[] env, TerminalSession.SessionChangedCallback sessionCallback) {
|
||||||
if (cwd == null) cwd = getFilesDir().getAbsolutePath();
|
if (cwd == null) cwd = getFilesDir().getAbsolutePath();
|
||||||
|
|
||||||
boolean isLoginShell = false;
|
boolean isLoginShell = false;
|
@ -1,7 +1,6 @@
|
|||||||
package io.neoterm
|
package io.neoterm.ui
|
||||||
|
|
||||||
import android.content.ComponentName
|
import android.content.ComponentName
|
||||||
import android.content.Context
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.ServiceConnection
|
import android.content.ServiceConnection
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
@ -11,18 +10,18 @@ import android.support.v4.view.OnApplyWindowInsetsListener
|
|||||||
import android.support.v4.view.ViewCompat
|
import android.support.v4.view.ViewCompat
|
||||||
import android.support.v7.app.AppCompatActivity
|
import android.support.v7.app.AppCompatActivity
|
||||||
import android.support.v7.widget.Toolbar
|
import android.support.v7.widget.Toolbar
|
||||||
import android.util.Log
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.inputmethod.InputMethodManager
|
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
import de.mrapp.android.tabswitcher.*
|
import de.mrapp.android.tabswitcher.*
|
||||||
import de.mrapp.android.tabswitcher.view.TabSwitcherButton
|
import de.mrapp.android.tabswitcher.view.TabSwitcherButton
|
||||||
|
import io.neoterm.R
|
||||||
import io.neoterm.preference.NeoTermPreference
|
import io.neoterm.preference.NeoTermPreference
|
||||||
import io.neoterm.tab.TermSessionChangedCallback
|
import io.neoterm.services.NeoTermService
|
||||||
import io.neoterm.tab.TermTab
|
import io.neoterm.view.tab.TermSessionChangedCallback
|
||||||
import io.neoterm.tab.TermTabDecorator
|
import io.neoterm.view.tab.TermTab
|
||||||
import io.neoterm.tab.TermViewClient
|
import io.neoterm.view.tab.TermTabDecorator
|
||||||
import io.neoterm.terminal.TerminalSession
|
import io.neoterm.view.tab.TermViewClient
|
||||||
|
import io.neoterm.backend.TerminalSession
|
||||||
|
|
||||||
|
|
||||||
class NeoTermActivity : AppCompatActivity(), ServiceConnection {
|
class NeoTermActivity : AppCompatActivity(), ServiceConnection {
|
@ -11,7 +11,7 @@ import android.widget.GridLayout;
|
|||||||
import android.widget.ToggleButton;
|
import android.widget.ToggleButton;
|
||||||
|
|
||||||
import io.neoterm.R;
|
import io.neoterm.R;
|
||||||
import io.neoterm.terminal.TerminalSession;
|
import io.neoterm.backend.TerminalSession;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A view showing extra keys (such as Escape, Ctrl, Alt) not normally available on an Android soft
|
* A view showing extra keys (such as Escape, Ctrl, Alt) not normally available on an Android soft
|
||||||
|
@ -5,11 +5,11 @@ import android.graphics.Paint;
|
|||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
|
|
||||||
import io.neoterm.terminal.TerminalBuffer;
|
import io.neoterm.backend.TerminalBuffer;
|
||||||
import io.neoterm.terminal.TerminalEmulator;
|
import io.neoterm.backend.TerminalEmulator;
|
||||||
import io.neoterm.terminal.TerminalRow;
|
import io.neoterm.backend.TerminalRow;
|
||||||
import io.neoterm.terminal.TextStyle;
|
import io.neoterm.backend.TextStyle;
|
||||||
import io.neoterm.terminal.WcWidth;
|
import io.neoterm.backend.WcWidth;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renderer of a {@link TerminalEmulator} into a {@link Canvas}.
|
* Renderer of a {@link TerminalEmulator} into a {@link Canvas}.
|
||||||
|
@ -30,11 +30,11 @@ import android.view.inputmethod.InputConnection;
|
|||||||
import android.widget.Scroller;
|
import android.widget.Scroller;
|
||||||
|
|
||||||
import io.neoterm.R;
|
import io.neoterm.R;
|
||||||
import io.neoterm.terminal.EmulatorDebug;
|
import io.neoterm.backend.EmulatorDebug;
|
||||||
import io.neoterm.terminal.KeyHandler;
|
import io.neoterm.backend.KeyHandler;
|
||||||
import io.neoterm.terminal.TerminalBuffer;
|
import io.neoterm.backend.TerminalBuffer;
|
||||||
import io.neoterm.terminal.TerminalEmulator;
|
import io.neoterm.backend.TerminalEmulator;
|
||||||
import io.neoterm.terminal.TerminalSession;
|
import io.neoterm.backend.TerminalSession;
|
||||||
|
|
||||||
/** View displaying and interacting with a {@link TerminalSession}. */
|
/** View displaying and interacting with a {@link TerminalSession}. */
|
||||||
public final class TerminalView extends View {
|
public final class TerminalView extends View {
|
||||||
|
@ -4,7 +4,7 @@ import android.view.KeyEvent;
|
|||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.ScaleGestureDetector;
|
import android.view.ScaleGestureDetector;
|
||||||
|
|
||||||
import io.neoterm.terminal.TerminalSession;
|
import io.neoterm.backend.TerminalSession;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Input and scale listener which may be set on a {@link TerminalView} through
|
* Input and scale listener which may be set on a {@link TerminalView} through
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package io.neoterm.tab
|
package io.neoterm.view.tab
|
||||||
|
|
||||||
import io.neoterm.terminal.TerminalSession
|
import io.neoterm.backend.TerminalSession
|
||||||
import io.neoterm.view.TerminalView
|
import io.neoterm.view.TerminalView
|
||||||
|
|
||||||
/**
|
/**
|
@ -1,11 +1,11 @@
|
|||||||
package io.neoterm.tab
|
package io.neoterm.view.tab
|
||||||
|
|
||||||
import android.os.Parcel
|
import android.os.Parcel
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
import android.support.v7.widget.Toolbar
|
import android.support.v7.widget.Toolbar
|
||||||
import de.mrapp.android.tabswitcher.Tab
|
import de.mrapp.android.tabswitcher.Tab
|
||||||
|
import io.neoterm.backend.TerminalSession
|
||||||
import io.neoterm.customize.NeoTermColorScheme
|
import io.neoterm.customize.NeoTermColorScheme
|
||||||
import io.neoterm.terminal.TerminalSession
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kiva
|
* @author kiva
|
@ -1,4 +1,4 @@
|
|||||||
package io.neoterm.tab
|
package io.neoterm.view.tab
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Typeface
|
import android.graphics.Typeface
|
||||||
@ -10,7 +10,7 @@ import android.view.ViewGroup
|
|||||||
import de.mrapp.android.tabswitcher.Tab
|
import de.mrapp.android.tabswitcher.Tab
|
||||||
import de.mrapp.android.tabswitcher.TabSwitcher
|
import de.mrapp.android.tabswitcher.TabSwitcher
|
||||||
import de.mrapp.android.tabswitcher.TabSwitcherDecorator
|
import de.mrapp.android.tabswitcher.TabSwitcherDecorator
|
||||||
import io.neoterm.NeoTermActivity
|
import io.neoterm.ui.NeoTermActivity
|
||||||
import io.neoterm.R
|
import io.neoterm.R
|
||||||
import io.neoterm.view.ExtraKeysView
|
import io.neoterm.view.ExtraKeysView
|
||||||
import io.neoterm.view.TerminalView
|
import io.neoterm.view.TerminalView
|
@ -1,11 +1,11 @@
|
|||||||
package io.neoterm.tab
|
package io.neoterm.view.tab
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.view.InputDevice
|
import android.view.InputDevice
|
||||||
import android.view.KeyEvent
|
import android.view.KeyEvent
|
||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
import android.view.inputmethod.InputMethodManager
|
import android.view.inputmethod.InputMethodManager
|
||||||
import io.neoterm.terminal.TerminalSession
|
import io.neoterm.backend.TerminalSession
|
||||||
import io.neoterm.view.ExtraKeysView
|
import io.neoterm.view.ExtraKeysView
|
||||||
import io.neoterm.view.TerminalView
|
import io.neoterm.view.TerminalView
|
||||||
import io.neoterm.view.TerminalViewClient
|
import io.neoterm.view.TerminalViewClient
|
Loading…
x
Reference in New Issue
Block a user