buttons on the bottom

Change-Id: I52184ad2752c38bcc4c7646b404f3f305e0ac4b6
This commit is contained in:
Joe Onorato
2010-07-01 16:39:39 -04:00
parent 86f9bd2fd0
commit 52c1dc2fd9
16 changed files with 177 additions and 5 deletions

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/* //device/apps/common/assets/res/any/dimens.xml
**
** Copyright 2006, 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.
*/
-->
<resources>
<dimen name="status_bar_height">50dip</dimen>
<!-- Height of the status bar -->
<dimen name="status_bar_icon_size">50dip</dimen>
<!-- Margin at the edge of the screen to ignore touch events for in the windowshade. -->
</resources>

View File

@@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -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"

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<drawable name="status_bar_background">#000000</drawable>
</resources>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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;

View File

@@ -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