summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlinuxx <io.nolinuxnoparty@gmail.com>2015-01-04 22:49:41 +0100
committerDanny Baumann <dannybaumann@web.de>2015-01-14 14:35:14 +0100
commitbac0a6dfe9601a79339ce1beead83017bd83c852 (patch)
treeff32f9185f692ab4ed8f00fffc781e3c54ec5f75
parentdf1166f61ee1b4bb157ac3692b35253d4781371c (diff)
downloadandroid_packages_apps_Terminal-bac0a6dfe9601a79339ce1beead83017bd83c852.tar.gz
android_packages_apps_Terminal-bac0a6dfe9601a79339ce1beead83017bd83c852.tar.bz2
android_packages_apps_Terminal-bac0a6dfe9601a79339ce1beead83017bd83c852.zip
Term: materialize
* New icon * Material UI * Vectors Change-Id: Ia5c3c9027662edd51021bf2183cd203d25bb7474
-rw-r--r--AndroidManifest.xml7
-rw-r--r--res/drawable-hdpi/ic_launcher.pngbin0 -> 1080 bytes
-rw-r--r--res/drawable-mdpi/ic_launcher.pngbin0 -> 898 bytes
-rw-r--r--res/drawable-xhdpi/ic_launcher.pngbin0 -> 1512 bytes
-rw-r--r--res/drawable-xxhdpi/ic_launcher.pngbin0 -> 1531 bytes
-rw-r--r--res/drawable-xxxhdpi/ic_launcher.pngbin0 -> 2151 bytes
-rw-r--r--res/drawable/ic_menu_add.xml15
-rw-r--r--res/drawable/ic_menu_close_clear_cancel.xml16
-rw-r--r--res/drawable/terminal.pngbin24319 -> 0 bytes
-rw-r--r--res/layout/activity.xml33
-rw-r--r--res/menu/activity.xml4
-rw-r--r--res/values/arrays.xml12
-rw-r--r--res/values/colors.xml20
-rw-r--r--res/values/styles.xml26
-rw-r--r--res/xml/settings.xml6
-rw-r--r--src/com/android/terminal/TerminalActivity.java8
-rw-r--r--src/com/android/terminal/TerminalSettingsActivity.java8
-rw-r--r--src/com/android/terminal/TerminalView.java6
18 files changed, 138 insertions, 23 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index b4d6f3a..bf41f13 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -17,15 +17,17 @@
package="com.android.terminal">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+ <uses-sdk android:minSdkVersion="21" />
<application
- android:icon="@drawable/terminal"
+ android:icon="@drawable/ic_launcher"
android:label="@string/app_label"
android:enabled="false">
<activity
android:name=".TerminalActivity"
- android:windowSoftInputMode="stateAlwaysVisible|adjustResize">
+ android:windowSoftInputMode="stateAlwaysVisible|adjustResize"
+ android:theme="@style/TermTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
@@ -36,6 +38,7 @@
<activity
android:name=".TerminalSettingsActivity"
android:label="@string/settings"
+ android:theme="@style/TermTheme"
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
diff --git a/res/drawable-hdpi/ic_launcher.png b/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..06ddfea
--- /dev/null
+++ b/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_launcher.png b/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..ca04996
--- /dev/null
+++ b/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_launcher.png b/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..a27ade6
--- /dev/null
+++ b/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_launcher.png b/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..9803eab
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_launcher.png b/res/drawable-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b94ea6b
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_launcher.png
Binary files differ
diff --git a/res/drawable/ic_menu_add.xml b/res/drawable/ic_menu_add.xml
new file mode 100644
index 0000000..8d446e8
--- /dev/null
+++ b/res/drawable/ic_menu_add.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="48dp"
+ android:height="48dp"
+ android:viewportWidth="48"
+ android:viewportHeight="48">
+
+ <group>
+ <path
+ android:fillColor="#fafafa"
+ android:pathData="M38 26h-12v12h-4v-12h-12v-4h12v-12h4v12h12v4Z" />
+ <path
+ android:pathData="M0 0h48v48h-48Z" />
+ </group>
+ </vector>
diff --git a/res/drawable/ic_menu_close_clear_cancel.xml b/res/drawable/ic_menu_close_clear_cancel.xml
new file mode 100644
index 0000000..4bb8f14
--- /dev/null
+++ b/res/drawable/ic_menu_close_clear_cancel.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="48dp"
+ android:height="48dp"
+ android:viewportWidth="48"
+ android:viewportHeight="48">
+
+ <group>
+ <path
+ android:fillColor="#fafafa"
+ android:pathData="M38 12.83l-2.83-2.83-11.17 11.17-11.17-11.17-2.83 2.83 11.17 11.17-11.17 11.17
+ 2.83 2.83 11.17-11.17 11.17 11.17 2.83-2.83-11.17-11.17Z" />
+ <path
+ android:pathData="M0 0h48v48h-48Z" />
+ </group>
+ </vector>
diff --git a/res/drawable/terminal.png b/res/drawable/terminal.png
deleted file mode 100644
index f256d10..0000000
--- a/res/drawable/terminal.png
+++ /dev/null
Binary files differ
diff --git a/res/layout/activity.xml b/res/layout/activity.xml
index 2138c5a..b1e201b 100644
--- a/res/layout/activity.xml
+++ b/res/layout/activity.xml
@@ -14,16 +14,33 @@
limitations under the License.
-->
-<android.support.v4.view.ViewPager
+<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/pager"
+ android:id="@+id/root"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:animateLayoutChanges="true">
- <android.support.v4.view.PagerTitleStrip
- android:id="@+id/titles"
+ <Toolbar
+ android:id="@+id/toolbar"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="top" />
+ android:layout_height="?android:attr/actionBarSize"
+ android:background="@color/primary" />
-</android.support.v4.view.ViewPager>
+ <android.support.v4.view.ViewPager
+ android:id="@+id/pager"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <android.support.v4.view.PagerTitleStrip
+ android:id="@+id/titles"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"
+ android:background="@color/primary"
+ android:elevation="8dp" />
+
+ </android.support.v4.view.ViewPager>
+
+</LinearLayout>
diff --git a/res/menu/activity.xml b/res/menu/activity.xml
index 74abfd3..8be82f1 100644
--- a/res/menu/activity.xml
+++ b/res/menu/activity.xml
@@ -18,12 +18,12 @@
<item
android:id="@+id/menu_new_tab"
android:title="@string/menu_new_tab"
- android:icon="@android:drawable/ic_menu_add"
+ android:icon="@drawable/ic_menu_add"
android:showAsAction="always" />
<item
android:id="@+id/menu_close_tab"
android:title="@string/menu_close_tab"
- android:icon="@android:drawable/ic_menu_close_clear_cancel"
+ android:icon="@drawable/ic_menu_close_clear_cancel"
android:showAsAction="ifRoom" />
<item
android:id="@+id/menu_item_settings"
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 1c83e9b..e91cdea 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -49,13 +49,15 @@
<item>Green text on black</item>
<item>Amber text on black</item>
<item>Red text on black</item>
+ <item>Blue text on black</item>
</string-array>
<string-array name="text_colors_values" translatable="false">
- <item>#000000/#ffffff</item>
- <item>#f0f0f0/#000000</item>
- <item>#00f000/#000000</item>
- <item>#f0c000/#000000</item>
- <item>#f00000/#000000</item>
+ <item>#212121/#fafafa</item>
+ <item>#fafafa/#212121</item>
+ <item>#4CAF50/#212121</item>
+ <item>#FF9800/#212121</item>
+ <item>#F44336/#212121</item>
+ <item>#3F51B5/#212121</item>
</string-array>
</resources>
diff --git a/res/values/colors.xml b/res/values/colors.xml
new file mode 100644
index 0000000..0bd1950
--- /dev/null
+++ b/res/values/colors.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 The CyanogenMod Project
+
+ 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>
+ <!-- Material -->
+ <color name="primary">#212121</color>
+ <color name="primary_dark">#424242</color>
+ <color name="accent">#fafafa</color>
+</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
new file mode 100644
index 0000000..7c8cb8f
--- /dev/null
+++ b/res/values/styles.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 The CyanogenMod Project
+
+ 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="TermTheme" parent="@android:Theme.Material">
+ <item name="android:colorPrimary">@color/primary</item>
+ <item name="android:colorPrimaryDark">@color/primary_dark</item>
+ <item name="android:colorAccent">@color/accent</item>
+ </style>
+ <style name="TermTheme.NoActionBar">
+ <item name="android:windowNoTitle">true</item>
+ <item name="android:windowActionBar">false</item>
+ </style>
+</resources>
diff --git a/res/xml/settings.xml b/res/xml/settings.xml
index 3bf1114..17ce40a 100644
--- a/res/xml/settings.xml
+++ b/res/xml/settings.xml
@@ -39,13 +39,15 @@
android:title="@string/font_size"
android:dialogTitle="@string/font_size_title"
android:entries="@array/font_size_labels"
- android:entryValues="@array/font_size_values" />
+ android:entryValues="@array/font_size_values"
+ android:defaultValue="12" />
<ListPreference
android:key="text_colors"
android:title="@string/text_colors"
android:dialogTitle="@string/text_colors_title"
android:entries="@array/text_colors_labels"
- android:entryValues="@array/text_colors_values" />
+ android:entryValues="@array/text_colors_values"
+ android:defaultValue="white/black" />
</PreferenceCategory>
<!-- Keyboard category -->
<!-- Shell category -->
diff --git a/src/com/android/terminal/TerminalActivity.java b/src/com/android/terminal/TerminalActivity.java
index 475ce40..875ef2b 100644
--- a/src/com/android/terminal/TerminalActivity.java
+++ b/src/com/android/terminal/TerminalActivity.java
@@ -18,6 +18,7 @@ package com.android.terminal;
import static com.android.terminal.Terminal.TAG;
+import android.animation.LayoutTransition;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
@@ -38,6 +39,7 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.Toolbar;
/**
* Activity that displays all {@link Terminal} instances running in a bound
@@ -198,6 +200,9 @@ public class TerminalActivity extends Activity {
setContentView(R.layout.activity);
+ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setActionBar(toolbar);
+
mPager = (ViewPager) findViewById(R.id.pager);
mTitles = (PagerTitleStrip) findViewById(R.id.titles);
@@ -205,6 +210,9 @@ public class TerminalActivity extends Activity {
View decorView = getWindow().getDecorView();
decorView.setOnSystemUiVisibilityChangeListener(mUiVisibilityChangeListener);
+
+ ViewGroup root = (ViewGroup) findViewById(R.id.root);
+ root.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
}
@Override
diff --git a/src/com/android/terminal/TerminalSettingsActivity.java b/src/com/android/terminal/TerminalSettingsActivity.java
index 6fd7b16..1e4338a 100644
--- a/src/com/android/terminal/TerminalSettingsActivity.java
+++ b/src/com/android/terminal/TerminalSettingsActivity.java
@@ -23,7 +23,6 @@ import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
import android.util.Log;
-import android.view.Menu;
import android.view.MenuItem;
import static com.android.terminal.Terminal.TAG;
@@ -56,6 +55,8 @@ public class TerminalSettingsActivity extends PreferenceActivity
mFontSizePref.setOnPreferenceChangeListener(this);
mTextColorsPref = (ListPreference) findPreference(KEY_TEXT_COLORS);
mTextColorsPref.setOnPreferenceChangeListener(this);
+
+ getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
@@ -65,6 +66,11 @@ public class TerminalSettingsActivity extends PreferenceActivity
@Override
public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case android.R.id.home:
+ finish();
+ return true;
+ }
return super.onOptionsItemSelected(item);
}
diff --git a/src/com/android/terminal/TerminalView.java b/src/com/android/terminal/TerminalView.java
index 974136a..0246167 100644
--- a/src/com/android/terminal/TerminalView.java
+++ b/src/com/android/terminal/TerminalView.java
@@ -368,9 +368,9 @@ public class TerminalView extends ListView {
val = sp.getString(TerminalSettingsActivity.KEY_FONT_SIZE, "12");
mMetrics.setTextSize(ptToDp(Float.parseFloat(val)));
- val = sp.getString(TerminalSettingsActivity.KEY_TEXT_COLORS, "black/white");
- int fg = 0x000000;
- int bg = 0xffffff;
+ val = sp.getString(TerminalSettingsActivity.KEY_TEXT_COLORS, "white/black");
+ int fg = 0xfafafa;
+ int bg = 0x212121;
int idx = val.indexOf('/');
if (idx != -1) {
try {