aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main
diff options
context:
space:
mode:
authorJeremy Klein <jlklein@google.com>2015-08-18 17:44:31 -0700
committerJeremy Klein <jlklein@google.com>2015-08-20 10:55:10 -0700
commitc3eb93ff1a7e119002b2532ed4687642d47c607b (patch)
treec9bb6891605216af86083285fe24440751adda3e /app/src/main
parent98979cf93c4f8ae6006ee50dde20a3a2cc83b6c9 (diff)
downloadconnectbot-c3eb93ff1a7e119002b2532ed4687642d47c607b.tar.gz
connectbot-c3eb93ff1a7e119002b2532ed4687642d47c607b.tar.bz2
connectbot-c3eb93ff1a7e119002b2532ed4687642d47c607b.zip
Remove ActionBarWrapper and style.xml files in favor of AppCompat.
The support libraries seem to provide better alternatives for everything in ActionBarWrapper and the style.xml definitions.
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/AndroidManifest.xml2
-rw-r--r--app/src/main/java/org/connectbot/ActionBarWrapper.java89
-rw-r--r--app/src/main/java/org/connectbot/ConsoleActivity.java11
-rw-r--r--app/src/main/res/layout-large/act_console.xml2
-rw-r--r--app/src/main/res/values-v11/styles.xml29
-rw-r--r--app/src/main/res/values-v14/styles.xml29
-rw-r--r--app/src/main/res/values/styles.xml25
7 files changed, 8 insertions, 179 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 7358c88..b578282 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -78,7 +78,7 @@
android:description="@string/service_desc" />
<activity android:name=".ConsoleActivity" android:configChanges="keyboardHidden|orientation"
- android:theme="@style/NoTitle" android:windowSoftInputMode="stateAlwaysVisible|adjustResize"
+ android:theme="@style/Theme.AppCompat" android:windowSoftInputMode="stateAlwaysVisible|adjustResize"
android:launchMode="singleTop" android:hardwareAccelerated="false">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
diff --git a/app/src/main/java/org/connectbot/ActionBarWrapper.java b/app/src/main/java/org/connectbot/ActionBarWrapper.java
deleted file mode 100644
index f6bed8c..0000000
--- a/app/src/main/java/org/connectbot/ActionBarWrapper.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * ConnectBot: simple, powerful, open-source SSH client for Android
- * Copyright 2007 Kenny Root, Jeffrey Sharkey
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.connectbot;
-
-import org.connectbot.util.PreferenceConstants;
-
-import android.annotation.TargetApi;
-import android.app.Activity;
-import android.app.ActionBar;
-
-public abstract class ActionBarWrapper {
- public interface OnMenuVisibilityListener {
- public void onMenuVisibilityChanged(boolean isVisible);
- }
-
- public static ActionBarWrapper getActionBar(Activity activity) {
- if (PreferenceConstants.PRE_HONEYCOMB)
- return new DummyActionBar();
- else
- return new RealActionBar(activity);
- }
-
- public void hide() {
- }
-
- public void show() {
- }
-
- public void addOnMenuVisibilityListener(OnMenuVisibilityListener listener) {
- }
-
- public void setDisplayHomeAsUpEnabled(boolean showHomeAsUp) {
- }
-
- private static class DummyActionBar extends ActionBarWrapper {
- }
-
- /**
- * Real ActionBar delegate that is only invoked on Honeycomb
- * and later.
- */
- @TargetApi(11)
- private static class RealActionBar extends ActionBarWrapper {
- private final ActionBar actionBar;
-
- public RealActionBar(Activity activity) {
- actionBar = activity.getActionBar();
- }
-
- @Override
- public void hide() {
- actionBar.hide();
- }
-
- @Override
- public void show() {
- actionBar.show();
- }
-
- @Override
- public void addOnMenuVisibilityListener(final OnMenuVisibilityListener listener) {
- actionBar.addOnMenuVisibilityListener(new ActionBar.OnMenuVisibilityListener() {
- public void onMenuVisibilityChanged(boolean isVisible) {
- listener.onMenuVisibilityChanged(isVisible);
- }
- });
- }
-
- @Override
- public void setDisplayHomeAsUpEnabled(boolean showHomeAsUp) {
- actionBar.setDisplayHomeAsUpEnabled(showHomeAsUp);
- }
- }
-}
diff --git a/app/src/main/java/org/connectbot/ConsoleActivity.java b/app/src/main/java/org/connectbot/ConsoleActivity.java
index d6ee629..9344938 100644
--- a/app/src/main/java/org/connectbot/ConsoleActivity.java
+++ b/app/src/main/java/org/connectbot/ConsoleActivity.java
@@ -30,7 +30,6 @@ import org.connectbot.service.TerminalKeyListener;
import org.connectbot.service.TerminalManager;
import org.connectbot.util.PreferenceConstants;
-import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.ComponentName;
@@ -55,6 +54,8 @@ import android.support.design.widget.TabLayout;
import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.ClipboardManager;
import android.util.Log;
@@ -91,7 +92,7 @@ import android.widget.TextView;
import android.widget.Toast;
import de.mud.terminal.vt320;
-public class ConsoleActivity extends Activity implements BridgeDisconnectedListener {
+public class ConsoleActivity extends AppCompatActivity implements BridgeDisconnectedListener {
public final static String TAG = "CB.ConsoleActivity";
protected static final int REQUEST_EDIT = 1;
@@ -148,7 +149,7 @@ public class ConsoleActivity extends Activity implements BridgeDisconnectedListe
private ImageView mKeyboardButton;
- private ActionBarWrapper actionBar;
+ private ActionBar actionBar;
private boolean inActionBarMenu = false;
private boolean titleBarHide;
@@ -451,12 +452,12 @@ public class ConsoleActivity extends Activity implements BridgeDisconnectedListe
findViewById(R.id.button_left).setOnClickListener(emulatedKeysListener);
findViewById(R.id.button_right).setOnClickListener(emulatedKeysListener);
- actionBar = ActionBarWrapper.getActionBar(this);
+ actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
if (titleBarHide) {
actionBar.hide();
}
- actionBar.addOnMenuVisibilityListener(new ActionBarWrapper.OnMenuVisibilityListener() {
+ actionBar.addOnMenuVisibilityListener(new ActionBar.OnMenuVisibilityListener() {
public void onMenuVisibilityChanged(boolean isVisible) {
inActionBarMenu = isVisible;
if (isVisible == false) {
diff --git a/app/src/main/res/layout-large/act_console.xml b/app/src/main/res/layout-large/act_console.xml
index d735333..f62281b 100644
--- a/app/src/main/res/layout-large/act_console.xml
+++ b/app/src/main/res/layout-large/act_console.xml
@@ -37,7 +37,7 @@
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
app:tabIndicatorColor="@android:color/white"
- android:background="#222222"/>
+ android:background="?attr/colorPrimary"/>
<TextView
android:id="@android:id/empty"
diff --git a/app/src/main/res/values-v11/styles.xml b/app/src/main/res/values-v11/styles.xml
deleted file mode 100644
index f831811..0000000
--- a/app/src/main/res/values-v11/styles.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * ConnectBot: simple, powerful, open-source SSH client for Android
- * Copyright 2007 Kenny Root, Jeffrey Sharkey
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<resources>
- <style name="NoTitle" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
- <item name="android:windowContentOverlay">@null</item>
- <item name="android:actionBarStyle">@style/SolidActionBar</item>
- </style>
-
- <style name="SolidActionBar" parent="android:Widget.Holo.ActionBar">
- <item name="android:background">#222222</item>
- </style>
-</resources>
diff --git a/app/src/main/res/values-v14/styles.xml b/app/src/main/res/values-v14/styles.xml
deleted file mode 100644
index f831811..0000000
--- a/app/src/main/res/values-v14/styles.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * ConnectBot: simple, powerful, open-source SSH client for Android
- * Copyright 2007 Kenny Root, Jeffrey Sharkey
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<resources>
- <style name="NoTitle" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
- <item name="android:windowContentOverlay">@null</item>
- <item name="android:actionBarStyle">@style/SolidActionBar</item>
- </style>
-
- <style name="SolidActionBar" parent="android:Widget.Holo.ActionBar">
- <item name="android:background">#222222</item>
- </style>
-</resources>
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
deleted file mode 100644
index f0cd073..0000000
--- a/app/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * ConnectBot: simple, powerful, open-source SSH client for Android
- * Copyright 2007 Kenny Root, Jeffrey Sharkey
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<resources>
- <style name="NoTitle" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
- <item name="android:windowNoTitle">true</item>
- <item name="android:windowContentOverlay">@null</item>
- </style>
-</resources>