use of jackpal.androidterm.emulatorview.TermSession 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.TermSession in project Android-Terminal-Emulator by jackpal.
the class Term method doEmailTranscript.
private void doEmailTranscript() {
TermSession session = getCurrentTermSession();
if (session != null) {
// Don't really want to supply an address, but
// currently it's required, otherwise nobody
// wants to handle the intent.
String addr = "user@example.com";
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:" + addr));
String subject = getString(R.string.email_transcript_subject);
String title = session.getTitle();
if (title != null) {
subject = subject + " - " + title;
}
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
intent.putExtra(Intent.EXTRA_TEXT, session.getTranscriptText().trim());
try {
startActivity(Intent.createChooser(intent, getString(R.string.email_transcript_chooser_title)));
} catch (ActivityNotFoundException e) {
Toast.makeText(this, R.string.email_transcript_no_email_activity_found, Toast.LENGTH_LONG).show();
}
}
}
use of jackpal.androidterm.emulatorview.TermSession in project Android-Terminal-Emulator by jackpal.
the class SessionList method addAll.
@Override
public boolean addAll(int index, Collection<? extends TermSession> collection) {
boolean result = super.addAll(index, collection);
for (TermSession session : collection) {
session.setTitleChangedListener(mTitleChangedListener);
}
notifyChange();
return result;
}
use of jackpal.androidterm.emulatorview.TermSession in project Android-Terminal-Emulator by jackpal.
the class SessionList method set.
@Override
public TermSession set(int index, TermSession object) {
TermSession old = super.set(index, object);
object.setTitleChangedListener(mTitleChangedListener);
if (old != null) {
old.setTitleChangedListener(null);
}
notifyChange();
return old;
}
use of jackpal.androidterm.emulatorview.TermSession in project Android-Terminal-Emulator by jackpal.
the class SessionList method addAll.
@Override
public boolean addAll(Collection<? extends TermSession> collection) {
boolean result = super.addAll(collection);
for (TermSession session : collection) {
session.setTitleChangedListener(mTitleChangedListener);
}
notifyChange();
return result;
}
Aggregations