use of jackpal.androidterm.emulatorview.EmulatorView in project Android-Terminal-Emulator by jackpal.
the class Term method updatePrefs.
private void updatePrefs() {
mUseKeyboardShortcuts = mSettings.getUseKeyboardShortcutsFlag();
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
mViewFlipper.updatePrefs(mSettings);
for (View v : mViewFlipper) {
((EmulatorView) v).setDensity(metrics);
((TermView) v).updatePrefs(mSettings);
}
if (mTermSessions != null) {
for (TermSession session : mTermSessions) {
((GenericTermSession) session).updatePrefs(mSettings);
}
}
{
Window win = getWindow();
WindowManager.LayoutParams params = win.getAttributes();
final int FULLSCREEN = WindowManager.LayoutParams.FLAG_FULLSCREEN;
int desiredFlag = mSettings.showStatusBar() ? 0 : FULLSCREEN;
if (desiredFlag != (params.flags & FULLSCREEN) || (AndroidCompat.SDK >= 11 && mActionBarMode != mSettings.actionBarMode())) {
if (mAlreadyStarted) {
// Can't switch to/from fullscreen after
// starting the activity.
restart();
} else {
win.setFlags(desiredFlag, FULLSCREEN);
if (mActionBarMode == TermSettings.ACTION_BAR_MODE_HIDES) {
if (mActionBar != null) {
mActionBar.hide();
}
}
}
}
}
int orientation = mSettings.getScreenOrientation();
int o = 0;
if (orientation == 0) {
o = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
} else if (orientation == 1) {
o = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
} else if (orientation == 2) {
o = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
} else {
/* Shouldn't be happened. */
}
setRequestedOrientation(o);
}
use of jackpal.androidterm.emulatorview.EmulatorView in project Android-Terminal-Emulator by jackpal.
the class Term method onConfigurationChanged.
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
mHaveFullHwKeyboard = checkHaveFullHwKeyboard(newConfig);
EmulatorView v = (EmulatorView) mViewFlipper.getCurrentView();
if (v != null) {
v.updateSize(false);
}
if (mWinListAdapter != null) {
// Force Android to redraw the label in the navigation dropdown
mWinListAdapter.notifyDataSetChanged();
}
}
use of jackpal.androidterm.emulatorview.EmulatorView in project Android-Terminal-Emulator by jackpal.
the class TermViewFlipper method showTitle.
private void showTitle() {
if (getChildCount() == 0) {
return;
}
EmulatorView view = (EmulatorView) getCurrentView();
if (view == null) {
return;
}
TermSession session = view.getTermSession();
if (session == null) {
return;
}
String title = context.getString(R.string.window_title, getDisplayedChild() + 1);
if (session instanceof GenericTermSession) {
title = ((GenericTermSession) session).getTitle(title);
}
if (mToast == null) {
mToast = Toast.makeText(context, title, Toast.LENGTH_SHORT);
mToast.setGravity(Gravity.CENTER, 0, 0);
} else {
mToast.setText(title);
}
mToast.show();
}
use of jackpal.androidterm.emulatorview.EmulatorView in project Android-Terminal-Emulator by jackpal.
the class TermViewFlipper method pauseCurrentView.
public void pauseCurrentView() {
EmulatorView view = (EmulatorView) getCurrentView();
if (view == null) {
return;
}
view.onPause();
}
use of jackpal.androidterm.emulatorview.EmulatorView in project Android-Terminal-Emulator by jackpal.
the class Term method doCloseWindow.
private void doCloseWindow() {
if (mTermSessions == null) {
return;
}
EmulatorView view = getCurrentEmulatorView();
if (view == null) {
return;
}
TermSession session = mTermSessions.remove(mViewFlipper.getDisplayedChild());
view.onPause();
session.finish();
mViewFlipper.removeView(view);
if (mTermSessions.size() != 0) {
mViewFlipper.showNext();
}
}
Aggregations