Skip to content

Commit

Permalink
The web terminal now opens in the Chrome custom tab
Browse files Browse the repository at this point in the history
  • Loading branch information
meefik committed Aug 25, 2018
1 parent e612cda commit e2d9d80
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Automatically change an interpreter in scripts after changing the environment directory
- Updated built-in busybox to v1.29.2
- Improved Arch Linux bootstrap
- The web terminal now opens in the Chrome custom tab (increases API to 15)

### Fixed
- Fixed problem with UID and GID numeration
Expand Down
5 changes: 3 additions & 2 deletions app/build.gradle
Expand Up @@ -6,9 +6,9 @@ android {

defaultConfig {
applicationId 'ru.meefik.linuxdeploy'
minSdkVersion 14
minSdkVersion 15
targetSdkVersion 27
versionCode 241
versionCode 242
versionName "2.2.0"
}
buildTypes {
Expand All @@ -25,4 +25,5 @@ android {

dependencies {
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
}
18 changes: 14 additions & 4 deletions app/src/main/java/ru/meefik/linuxdeploy/MainActivity.java
Expand Up @@ -6,13 +6,15 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.Color;
import android.net.Uri;
import android.net.wifi.WifiManager;
import android.net.wifi.WifiManager.WifiLock;
import android.os.Bundle;
import android.os.Handler;
import android.os.PowerManager;
import android.support.annotation.NonNull;
import android.support.customtabs.CustomTabsIntent;
import android.support.design.widget.NavigationView;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
Expand Down Expand Up @@ -162,10 +164,18 @@ public boolean onNavigationItemSelected(MenuItem item) {
openRepository();
break;
case R.id.nav_terminal:
Intent browserIntent = new Intent(Intent.ACTION_VIEW,

This comment has been minimized.

Copy link
@usandourkids525

usandourkids525 Aug 2, 2020

= known

Uri.parse("http://127.0.0.1:" + PrefStore.getHttpPort(this) +
"/cgi-bin/terminal?size=" + PrefStore.getFontSize(this)));
startActivity(browserIntent);
String uri = "http://127.0.0.1:" + PrefStore.getHttpPort(this) +
"/cgi-bin/terminal?size=" + PrefStore.getFontSize(this);
// Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
// startActivity(browserIntent);
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
if (PrefStore.getTheme(this) == R.style.LightTheme) {
builder.setToolbarColor(Color.LTGRAY);
} else {
builder.setToolbarColor(Color.DKGRAY);
}
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.launchUrl(this, Uri.parse(uri));
break;
case R.id.nav_settings:
Intent intent_settings = new Intent(this, SettingsActivity.class);
Expand Down

0 comments on commit e2d9d80

Please sign in to comment.