summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2010-08-10 22:11:35 -0700
committerAdam Cohen <adamcohen@google.com>2010-08-11 10:46:55 -0700
commitda4dc5edd82a40c3950fc8221c6363b9826204aa (patch)
tree79195b37b940ae2e26ee8fa8245fcb70796468f6
parenta67e867db9d639ed2afcc97e9d04a67fc46f2669 (diff)
downloadandroid_packages_apps_Trebuchet-da4dc5edd82a40c3950fc8221c6363b9826204aa.zip
android_packages_apps_Trebuchet-da4dc5edd82a40c3950fc8221c6363b9826204aa.tar.gz
android_packages_apps_Trebuchet-da4dc5edd82a40c3950fc8221c6363b9826204aa.tar.bz2
-> Set grid to 8x7 with proper spacing for landscape/portrait
-> Added a button to the top left of Launcher which switches between landscape and portrait. For testing purposes only. Change-Id: I01f8cfcf92c8ba7727eeba0e59a0b8ff055598fe
-rw-r--r--AndroidManifest.xml2
-rw-r--r--res/drawable-xlarge/rotate_button.xml20
-rw-r--r--res/drawable-xlarge/rotate_button_normal.pngbin0 -> 6252 bytes
-rw-r--r--res/drawable-xlarge/rotate_button_pressed.pngbin0 -> 6388 bytes
-rw-r--r--res/layout-xlarge-land/workspace_screen.xml30
-rw-r--r--res/layout-xlarge-port/workspace_screen.xml (renamed from res/layout-xlarge/workspace_screen.xml)8
-rw-r--r--res/layout-xlarge/launcher.xml34
-rw-r--r--src/com/android/launcher2/Launcher.java13
8 files changed, 93 insertions, 14 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 91023d0..b10ab92 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -74,8 +74,6 @@
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:theme="@style/Theme"
- android:screenOrientation="nosensor"
- android:configChanges="orientation"
android:windowSoftInputMode="stateUnspecified|adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
diff --git a/res/drawable-xlarge/rotate_button.xml b/res/drawable-xlarge/rotate_button.xml
new file mode 100644
index 0000000..c29efa4
--- /dev/null
+++ b/res/drawable-xlarge/rotate_button.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source 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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true" android:drawable="@drawable/rotate_button_pressed" />
+ <item android:drawable="@drawable/rotate_button_normal" />
+</selector>
diff --git a/res/drawable-xlarge/rotate_button_normal.png b/res/drawable-xlarge/rotate_button_normal.png
new file mode 100644
index 0000000..fd014aa
--- /dev/null
+++ b/res/drawable-xlarge/rotate_button_normal.png
Binary files differ
diff --git a/res/drawable-xlarge/rotate_button_pressed.png b/res/drawable-xlarge/rotate_button_pressed.png
new file mode 100644
index 0000000..29fb8d9
--- /dev/null
+++ b/res/drawable-xlarge/rotate_button_pressed.png
Binary files differ
diff --git a/res/layout-xlarge-land/workspace_screen.xml b/res/layout-xlarge-land/workspace_screen.xml
new file mode 100644
index 0000000..15fc3b1
--- /dev/null
+++ b/res/layout-xlarge-land/workspace_screen.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source 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.
+-->
+
+<com.android.launcher2.CellLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:hapticFeedbackEnabled="false"
+
+ launcher:cellWidth="@dimen/workspace_cell_width"
+ launcher:cellHeight="@dimen/workspace_cell_height"
+ launcher:yAxisStartPadding="40dip"
+ launcher:yAxisEndPadding="40dip"
+ launcher:xAxisStartPadding="256dip"
+ launcher:xAxisEndPadding="256dip" />
diff --git a/res/layout-xlarge/workspace_screen.xml b/res/layout-xlarge-port/workspace_screen.xml
index 6a34975..eb7620c 100644
--- a/res/layout-xlarge/workspace_screen.xml
+++ b/res/layout-xlarge-port/workspace_screen.xml
@@ -24,7 +24,7 @@
launcher:cellWidth="@dimen/workspace_cell_width"
launcher:cellHeight="@dimen/workspace_cell_height"
- launcher:yAxisStartPadding="8dip"
- launcher:yAxisEndPadding="8dip"
- launcher:xAxisStartPadding="8dip"
- launcher:xAxisEndPadding="8dip"/>
+ launcher:yAxisStartPadding="172dip"
+ launcher:yAxisEndPadding="172dip"
+ launcher:xAxisStartPadding="40dip"
+ launcher:xAxisEndPadding="40dip"/>
diff --git a/res/layout-xlarge/launcher.xml b/res/layout-xlarge/launcher.xml
index 6eb9318..a1879ef 100644
--- a/res/layout-xlarge/launcher.xml
+++ b/res/layout-xlarge/launcher.xml
@@ -36,7 +36,7 @@
android:layout_height="match_parent"
launcher:defaultScreen="2"
launcher:cellCountX="8"
- launcher:cellCountY="4">
+ launcher:cellCountY="7">
<include android:id="@+id/cell1" layout="@layout/workspace_screen" />
<include android:id="@+id/cell2" layout="@layout/workspace_screen" />
@@ -45,21 +45,39 @@
<include android:id="@+id/cell5" layout="@layout/workspace_screen" />
</com.android.launcher2.Workspace>
- <ImageView
- android:id="@+id/search_button"
+ <RelativeLayout
+ android:id="@+id/search_button_cluster"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:src="@drawable/search_button"
+ android:layout_gravity="top|left">
+
+ <ImageView
+ android:id="@+id/search_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/search_button"
+
+ android:onClick="onClickSearchButton"
+ android:focusable="true"
+ android:clickable="true"/>
+ <ImageView
+ android:id="@+id/rotate_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/rotate_button"
+
+ android:onClick="onClickRotateButton"
+ android:focusable="true"
+ android:clickable="true"
+ android:layout_toRightOf="@id/search_button" />
+ </RelativeLayout>
- android:onClick="onClickSearchButton"
- android:focusable="true"
- android:clickable="true"
- android:layout_gravity="top|left"/>
<RelativeLayout
android:id="@+id/all_apps_button_cluster"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|right">
+
<ImageView
android:id="@+id/configure_button"
android:layout_width="wrap_content"
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 008b636..d7ce6f2 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -1625,6 +1625,19 @@ public final class Launcher extends Activity
}
/**
+ * Temporary: to allow us to test rotation in the launcher.
+ *
+ * @param v The view that was clicked.
+ */
+ public void onClickRotateButton(View v) {
+ // TODO: this method is temporary. Remove it.
+ setRequestedOrientation(
+ (getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
+ ? ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
+ : ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
+ }
+
+ /**
* Event handler for the "grid" button that appears on the home screen, which
* enters all apps mode.
*