diff options
| author | Joe Onorato <joeo@android.com> | 2010-07-01 16:39:39 -0400 |
|---|---|---|
| committer | Joe Onorato <joeo@android.com> | 2010-07-07 18:33:14 -0400 |
| commit | 52c1dc2fd99eabed1914e390143d3d74799e6366 (patch) | |
| tree | 286e622c3ce795e323794c1d15ce6775b7ce79dd /packages/SystemUI | |
| parent | 86f9bd2fd054522e36f84776056cd07531ead9cf (diff) | |
| download | frameworks_base-52c1dc2fd99eabed1914e390143d3d74799e6366.zip frameworks_base-52c1dc2fd99eabed1914e390143d3d74799e6366.tar.gz frameworks_base-52c1dc2fd99eabed1914e390143d3d74799e6366.tar.bz2 | |
buttons on the bottom
Change-Id: I52184ad2752c38bcc4c7646b404f3f305e0ac4b6
Diffstat (limited to 'packages/SystemUI')
15 files changed, 151 insertions, 5 deletions
diff --git a/packages/SystemUI/res/drawable/status_bar_back.xml b/packages/SystemUI/res/drawable/status_bar_back.xml new file mode 100644 index 0000000..92bf147 --- /dev/null +++ b/packages/SystemUI/res/drawable/status_bar_back.xml @@ -0,0 +1,21 @@ +<?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. +--> + +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true" android:drawable="@drawable/status_bar_back_pressed" /> + <item android:drawable="@drawable/status_bar_back_default" /> +</selector> + diff --git a/packages/SystemUI/res/drawable/status_bar_back_default.png b/packages/SystemUI/res/drawable/status_bar_back_default.png Binary files differnew file mode 100644 index 0000000..e6648f7 --- /dev/null +++ b/packages/SystemUI/res/drawable/status_bar_back_default.png diff --git a/packages/SystemUI/res/drawable/status_bar_back_pressed.png b/packages/SystemUI/res/drawable/status_bar_back_pressed.png Binary files differnew file mode 100644 index 0000000..b25fba2 --- /dev/null +++ b/packages/SystemUI/res/drawable/status_bar_back_pressed.png diff --git a/packages/SystemUI/res/drawable/status_bar_home.xml b/packages/SystemUI/res/drawable/status_bar_home.xml new file mode 100644 index 0000000..0011711 --- /dev/null +++ b/packages/SystemUI/res/drawable/status_bar_home.xml @@ -0,0 +1,21 @@ +<?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. +--> + +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true" android:drawable="@drawable/status_bar_home_pressed" /> + <item android:drawable="@drawable/status_bar_home_default" /> +</selector> + diff --git a/packages/SystemUI/res/drawable/status_bar_home_default.png b/packages/SystemUI/res/drawable/status_bar_home_default.png Binary files differnew file mode 100644 index 0000000..ccfcb95 --- /dev/null +++ b/packages/SystemUI/res/drawable/status_bar_home_default.png diff --git a/packages/SystemUI/res/drawable/status_bar_home_pressed.png b/packages/SystemUI/res/drawable/status_bar_home_pressed.png Binary files differnew file mode 100644 index 0000000..f91e399 --- /dev/null +++ b/packages/SystemUI/res/drawable/status_bar_home_pressed.png diff --git a/packages/SystemUI/res/drawable/status_bar_menu.xml b/packages/SystemUI/res/drawable/status_bar_menu.xml new file mode 100644 index 0000000..aa7286e --- /dev/null +++ b/packages/SystemUI/res/drawable/status_bar_menu.xml @@ -0,0 +1,21 @@ +<?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. +--> + +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true" android:drawable="@drawable/status_bar_menu_pressed" /> + <item android:drawable="@drawable/status_bar_menu_default" /> +</selector> + diff --git a/packages/SystemUI/res/drawable/status_bar_menu_default.png b/packages/SystemUI/res/drawable/status_bar_menu_default.png Binary files differnew file mode 100644 index 0000000..2499d3e --- /dev/null +++ b/packages/SystemUI/res/drawable/status_bar_menu_default.png diff --git a/packages/SystemUI/res/drawable/status_bar_menu_pressed.png b/packages/SystemUI/res/drawable/status_bar_menu_pressed.png Binary files differnew file mode 100644 index 0000000..0acd143 --- /dev/null +++ b/packages/SystemUI/res/drawable/status_bar_menu_pressed.png diff --git a/packages/SystemUI/res/layout/status_bar.xml b/packages/SystemUI/res/layout/status_bar.xml index 5fe8e79..4667149 100644 --- a/packages/SystemUI/res/layout/status_bar.xml +++ b/packages/SystemUI/res/layout/status_bar.xml @@ -21,6 +21,7 @@ <!-- android:background="@drawable/status_bar_closed_default_background" --> <com.android.systemui.statusbar.StatusBarView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:background="@drawable/status_bar_background" android:orientation="vertical" android:focusable="true" @@ -59,6 +60,33 @@ android:textStyle="bold" android:gravity="center_vertical|left" /> + + <LinearLayout android:id="@+id/buttons" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingLeft="6dip" + android:orientation="horizontal" > + + <com.android.systemui.statusbar.KeyButtonView android:id="@+id/back" + android:layout_width="wrap_content" + android:layout_height="@*android:dimen/status_bar_height" + android:src="@drawable/status_bar_back" + systemui:keyCode="4" + /> + <com.android.systemui.statusbar.KeyButtonView android:id="@+id/menu" + android:layout_width="wrap_content" + android:layout_height="@*android:dimen/status_bar_height" + android:src="@drawable/status_bar_menu" + systemui:keyCode="82" + /> + <com.android.systemui.statusbar.KeyButtonView android:id="@+id/home" + android:layout_width="wrap_content" + android:layout_height="@*android:dimen/status_bar_height" + android:src="@drawable/status_bar_home" + systemui:keyCode="3" + /> + </LinearLayout> + </LinearLayout> <LinearLayout android:id="@+id/ticker" diff --git a/packages/SystemUI/res/values-xlarge/colors.xml b/packages/SystemUI/res/values-xlarge/colors.xml new file mode 100644 index 0000000..14161c3 --- /dev/null +++ b/packages/SystemUI/res/values-xlarge/colors.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <drawable name="status_bar_background">#000000</drawable> +</resources> + diff --git a/packages/SystemUI/res/values-xlarge/config.xml b/packages/SystemUI/res/values-xlarge/config.xml new file mode 100644 index 0000000..4cf5d18d11 --- /dev/null +++ b/packages/SystemUI/res/values-xlarge/config.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 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. +*/ +--> + +<!-- These resources are around just to allow their values to be customized + for different hardware and product builds. --> +<resources> + <integer name="config_status_bar_position">1</integer> +</resources> + diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 8ea46e5..ac00c69 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -20,7 +20,16 @@ <!-- These resources are around just to allow their values to be customized for different hardware and product builds. --> <resources> - <!-- Control whether status bar should distinguish HSPA data icon form UMTS data icon on devices --> + + <!-- Control whether status bar should distinguish HSPA data icon form UMTS + data icon on devices --> <bool name="config_hspa_data_distinguishable">false</bool> + + <!-- The location of the status bar. + 0 - top + 1 - bottom + --> + <integer name="config_status_bar_position">0</integer> + </resources> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java index 07bcce7..c9fee74 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java @@ -97,6 +97,9 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks // will likely move to a resource or other tunable param at some point private static final int INTRUDER_ALERT_DECAY_MS = 10000; + static final int POSITION_TOP = 0; + static final int POSITION_BOTTOM = 0; + StatusBarPolicy mIconPolicy; CommandQueue mCommandQueue; @@ -104,6 +107,8 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks int mIconSize; Display mDisplay; + int mPosition; + StatusBarView mStatusBarView; int mPixelFormat; H mHandler = new H(); @@ -193,10 +198,11 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks } } - @Override public void onCreate() { // First set up our views and stuff. + final Resources res = getResources(); + mPosition = res.getInteger(R.integer.config_status_bar_position); mDisplay = ((WindowManager)getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); makeStatusBarView(this); @@ -349,7 +355,11 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING, PixelFormat.RGBX_8888); - lp.gravity = Gravity.TOP | Gravity.FILL_HORIZONTAL; + if (mPosition == POSITION_TOP) { + lp.gravity = Gravity.TOP | Gravity.FILL_HORIZONTAL; + } else { + lp.gravity = Gravity.BOTTOM | Gravity.FILL_HORIZONTAL; + } lp.setTitle("StatusBar"); // TODO lp.windowAnimations = R.style.Animation_StatusBar; @@ -365,7 +375,11 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM, PixelFormat.TRANSLUCENT); - lp.gravity = Gravity.TOP | Gravity.FILL_HORIZONTAL; + if (mPosition == POSITION_TOP) { + lp.gravity = Gravity.TOP | Gravity.FILL_HORIZONTAL; + } else { + lp.gravity = Gravity.BOTTOM | Gravity.FILL_HORIZONTAL; + } lp.y += height * 1.5; // FIXME lp.setTitle("IntruderAlert"); lp.windowAnimations = com.android.internal.R.style.Animation_StatusBar_IntruderAlert; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarView.java index 95f2fe5..57452af 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarView.java @@ -133,7 +133,9 @@ public class StatusBarView extends FrameLayout { mDate.layout(mDate.getLeft(), mDate.getTop(), newDateRight, mDate.getBottom()); mBackground.setFixedBounds(-mDate.getLeft(), -mDate.getTop(), (r-l), (b-t)); - mButtonArea.getHitRect(mButtonBounds); + if (mButtonArea != null) { + mButtonArea.getHitRect(mButtonBounds); + } } @Override |
