From 755cc74e4cebdf67d21a2477512a4ac9b01e8323 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Sat, 27 Nov 2010 15:45:35 -0800 Subject: Rename the status bar layouts to more consistent names Change-Id: Ic593e6c93794f2a2eb36576501d35be54a0a0681 --- .../res/layout-xlarge/status_bar_latest_event.xml | 48 --- .../status_bar_notification_panel.xml | 164 +++++++++ .../layout-xlarge/status_bar_notification_peek.xml | 43 +++ .../layout-xlarge/status_bar_notification_row.xml | 48 +++ .../res/layout-xlarge/status_bar_pocket_panel.xml | 61 ++++ .../res/layout-xlarge/status_bar_recent_item.xml | 59 +++ .../res/layout-xlarge/status_bar_recent_panel.xml | 53 +++ .../res/layout-xlarge/status_bar_settings_view.xml | 170 +++++++++ .../res/layout-xlarge/status_bar_ticker_compat.xml | 58 +++ .../res/layout-xlarge/status_bar_ticker_panel.xml | 39 ++ .../sysbar_panel_notification_peek.xml | 43 --- .../layout-xlarge/sysbar_panel_notifications.xml | 164 --------- .../res/layout-xlarge/sysbar_panel_pocket.xml | 61 ---- .../res/layout-xlarge/sysbar_panel_recent.xml | 53 --- .../res/layout-xlarge/sysbar_panel_recent_item.xml | 59 --- .../res/layout-xlarge/sysbar_panel_settings.xml | 170 --------- .../res/layout-xlarge/sysbar_panel_system.xml | 213 ----------- packages/SystemUI/res/layout-xlarge/ticker.xml | 39 -- .../SystemUI/res/layout-xlarge/ticker_compat.xml | 58 --- .../SystemUI/res/layout-xlarge/ticker_icon.xml | 25 -- .../res/layout/status_bar_latest_event.xml | 24 -- .../res/layout/status_bar_notification_row.xml | 24 ++ .../systemui/statusbar/phone/PhoneStatusBar.java | 2 +- .../statusbar/tablet/NotificationPanel.java | 22 +- .../systemui/statusbar/tablet/RecentAppsPanel.java | 2 +- .../systemui/statusbar/tablet/SettingsPanel.java | 99 ----- .../systemui/statusbar/tablet/SettingsView.java | 99 +++++ .../systemui/statusbar/tablet/ShirtPocket.java | 2 +- .../systemui/statusbar/tablet/SystemPanel.java | 403 --------------------- .../systemui/statusbar/tablet/TabletStatusBar.java | 12 +- .../systemui/statusbar/tablet/TabletTicker.java | 4 +- 31 files changed, 840 insertions(+), 1481 deletions(-) delete mode 100644 packages/SystemUI/res/layout-xlarge/status_bar_latest_event.xml create mode 100644 packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml create mode 100644 packages/SystemUI/res/layout-xlarge/status_bar_notification_peek.xml create mode 100644 packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml create mode 100644 packages/SystemUI/res/layout-xlarge/status_bar_pocket_panel.xml create mode 100644 packages/SystemUI/res/layout-xlarge/status_bar_recent_item.xml create mode 100644 packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml create mode 100644 packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml create mode 100644 packages/SystemUI/res/layout-xlarge/status_bar_ticker_compat.xml create mode 100644 packages/SystemUI/res/layout-xlarge/status_bar_ticker_panel.xml delete mode 100644 packages/SystemUI/res/layout-xlarge/sysbar_panel_notification_peek.xml delete mode 100644 packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml delete mode 100644 packages/SystemUI/res/layout-xlarge/sysbar_panel_pocket.xml delete mode 100644 packages/SystemUI/res/layout-xlarge/sysbar_panel_recent.xml delete mode 100644 packages/SystemUI/res/layout-xlarge/sysbar_panel_recent_item.xml delete mode 100644 packages/SystemUI/res/layout-xlarge/sysbar_panel_settings.xml delete mode 100644 packages/SystemUI/res/layout-xlarge/sysbar_panel_system.xml delete mode 100644 packages/SystemUI/res/layout-xlarge/ticker.xml delete mode 100644 packages/SystemUI/res/layout-xlarge/ticker_compat.xml delete mode 100644 packages/SystemUI/res/layout-xlarge/ticker_icon.xml delete mode 100644 packages/SystemUI/res/layout/status_bar_latest_event.xml create mode 100644 packages/SystemUI/res/layout/status_bar_notification_row.xml delete mode 100644 packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsPanel.java create mode 100644 packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java delete mode 100644 packages/SystemUI/src/com/android/systemui/statusbar/tablet/SystemPanel.java (limited to 'packages') diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_latest_event.xml b/packages/SystemUI/res/layout-xlarge/status_bar_latest_event.xml deleted file mode 100644 index 6b12d29..0000000 --- a/packages/SystemUI/res/layout-xlarge/status_bar_latest_event.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml new file mode 100644 index 0000000..fb4cf3f --- /dev/null +++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_peek.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_peek.xml new file mode 100644 index 0000000..02f9a90 --- /dev/null +++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_peek.xml @@ -0,0 +1,43 @@ + + + + + + + + + diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml new file mode 100644 index 0000000..6b12d29 --- /dev/null +++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_pocket_panel.xml b/packages/SystemUI/res/layout-xlarge/status_bar_pocket_panel.xml new file mode 100644 index 0000000..e4a6da4 --- /dev/null +++ b/packages/SystemUI/res/layout-xlarge/status_bar_pocket_panel.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_recent_item.xml b/packages/SystemUI/res/layout-xlarge/status_bar_recent_item.xml new file mode 100644 index 0000000..b1997b8 --- /dev/null +++ b/packages/SystemUI/res/layout-xlarge/status_bar_recent_item.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml b/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml new file mode 100644 index 0000000..ac038a7 --- /dev/null +++ b/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml b/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml new file mode 100644 index 0000000..d4a0d95 --- /dev/null +++ b/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_ticker_compat.xml b/packages/SystemUI/res/layout-xlarge/status_bar_ticker_compat.xml new file mode 100644 index 0000000..5d9a680 --- /dev/null +++ b/packages/SystemUI/res/layout-xlarge/status_bar_ticker_compat.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_ticker_panel.xml b/packages/SystemUI/res/layout-xlarge/status_bar_ticker_panel.xml new file mode 100644 index 0000000..cae6a77 --- /dev/null +++ b/packages/SystemUI/res/layout-xlarge/status_bar_ticker_panel.xml @@ -0,0 +1,39 @@ + + + + + + + + + + diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_notification_peek.xml b/packages/SystemUI/res/layout-xlarge/sysbar_panel_notification_peek.xml deleted file mode 100644 index 02f9a90..0000000 --- a/packages/SystemUI/res/layout-xlarge/sysbar_panel_notification_peek.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml b/packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml deleted file mode 100644 index fb4cf3f..0000000 --- a/packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_pocket.xml b/packages/SystemUI/res/layout-xlarge/sysbar_panel_pocket.xml deleted file mode 100644 index e4a6da4..0000000 --- a/packages/SystemUI/res/layout-xlarge/sysbar_panel_pocket.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_recent.xml b/packages/SystemUI/res/layout-xlarge/sysbar_panel_recent.xml deleted file mode 100644 index ac038a7..0000000 --- a/packages/SystemUI/res/layout-xlarge/sysbar_panel_recent.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_recent_item.xml b/packages/SystemUI/res/layout-xlarge/sysbar_panel_recent_item.xml deleted file mode 100644 index b1997b8..0000000 --- a/packages/SystemUI/res/layout-xlarge/sysbar_panel_recent_item.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_settings.xml b/packages/SystemUI/res/layout-xlarge/sysbar_panel_settings.xml deleted file mode 100644 index 8419f02..0000000 --- a/packages/SystemUI/res/layout-xlarge/sysbar_panel_settings.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_system.xml b/packages/SystemUI/res/layout-xlarge/sysbar_panel_system.xml deleted file mode 100644 index a1792fd..0000000 --- a/packages/SystemUI/res/layout-xlarge/sysbar_panel_system.xml +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/SystemUI/res/layout-xlarge/ticker.xml b/packages/SystemUI/res/layout-xlarge/ticker.xml deleted file mode 100644 index cae6a77..0000000 --- a/packages/SystemUI/res/layout-xlarge/ticker.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - diff --git a/packages/SystemUI/res/layout-xlarge/ticker_compat.xml b/packages/SystemUI/res/layout-xlarge/ticker_compat.xml deleted file mode 100644 index 5d9a680..0000000 --- a/packages/SystemUI/res/layout-xlarge/ticker_compat.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - diff --git a/packages/SystemUI/res/layout-xlarge/ticker_icon.xml b/packages/SystemUI/res/layout-xlarge/ticker_icon.xml deleted file mode 100644 index 9efa987..0000000 --- a/packages/SystemUI/res/layout-xlarge/ticker_icon.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - diff --git a/packages/SystemUI/res/layout/status_bar_latest_event.xml b/packages/SystemUI/res/layout/status_bar_latest_event.xml deleted file mode 100644 index 88d9739..0000000 --- a/packages/SystemUI/res/layout/status_bar_latest_event.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - diff --git a/packages/SystemUI/res/layout/status_bar_notification_row.xml b/packages/SystemUI/res/layout/status_bar_notification_row.xml new file mode 100644 index 0000000..88d9739 --- /dev/null +++ b/packages/SystemUI/res/layout/status_bar_notification_row.xml @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 5391178..0d6c5f6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -505,7 +505,7 @@ public class PhoneStatusBar extends StatusBar { // create the row view LayoutInflater inflater = (LayoutInflater)mContext.getSystemService( Context.LAYOUT_INFLATER_SERVICE); - View row = inflater.inflate(R.layout.status_bar_latest_event, parent, false); + View row = inflater.inflate(R.layout.status_bar_notification_row, parent, false); // bind the click event to the content area ViewGroup content = (ViewGroup)row.findViewById(R.id.content); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java index 5f49d8c..a5ff571 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java @@ -37,7 +37,7 @@ public class NotificationPanel extends LinearLayout implements StatusBarPanel, View mNotificationButton; View mNotificationScroller; FrameLayout mContentFrame; - View mSettingsPanel; + View mSettingsView; public NotificationPanel(Context context, AttributeSet attrs) { this(context, attrs, 0); @@ -103,15 +103,15 @@ public class NotificationPanel extends LinearLayout implements StatusBarPanel, } public void switchToSettingsMode() { - removeSettingsPanel(); - addSettingsPanel(); + removeSettingsView(); + addSettingsView(); mSettingsButton.setVisibility(View.INVISIBLE); mNotificationScroller.setVisibility(View.GONE); mNotificationButton.setVisibility(View.VISIBLE); } public void switchToNotificationMode() { - removeSettingsPanel(); + removeSettingsView(); mSettingsButton.setVisibility(View.VISIBLE); mNotificationScroller.setVisibility(View.VISIBLE); mNotificationButton.setVisibility(View.INVISIBLE); @@ -125,17 +125,17 @@ public class NotificationPanel extends LinearLayout implements StatusBarPanel, return x >= l && x < r && y >= t && y < b; } - void removeSettingsPanel() { - if (mSettingsPanel != null) { - mContentFrame.removeView(mSettingsPanel); - mSettingsPanel = null; + void removeSettingsView() { + if (mSettingsView != null) { + mContentFrame.removeView(mSettingsView); + mSettingsView = null; } } - void addSettingsPanel() { + void addSettingsView() { LayoutInflater infl = LayoutInflater.from(getContext()); - mSettingsPanel = infl.inflate(R.layout.sysbar_panel_settings, mContentFrame, false); - mContentFrame.addView(mSettingsPanel); + mSettingsView = infl.inflate(R.layout.status_bar_settings_view, mContentFrame, false); + mContentFrame.addView(mSettingsView); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java index 0c31304..546750b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java @@ -224,7 +224,7 @@ public class RecentAppsPanel extends LinearLayout implements StatusBarPanel, OnC final int last = Math.min(mActivityDescriptions.size(), DISPLAY_TASKS) - 1; for (int i = last; i >= first; i--) { ActivityDescription activityDescription = mActivityDescriptions.get(i); - View view = View.inflate(mContext, R.layout.sysbar_panel_recent_item, null); + View view = View.inflate(mContext, R.layout.status_bar_recent_item, null); ImageView appThumbnail = (ImageView) view.findViewById(R.id.app_thumbnail); ImageView appIcon = (ImageView) view.findViewById(R.id.app_icon); TextView appDescription = (TextView) view.findViewById(R.id.app_label); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsPanel.java deleted file mode 100644 index fea326e..0000000 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsPanel.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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. - */ - -package com.android.systemui.statusbar.tablet; - -import android.app.StatusBarManager; -import android.content.Context; -import android.content.Intent; -import android.provider.Settings; -import android.util.AttributeSet; -import android.util.Slog; -import android.widget.LinearLayout; -import android.view.View; -import android.widget.CompoundButton; -import android.widget.ImageView; -import android.widget.TextView; - -import com.android.systemui.R; -import com.android.systemui.statusbar.policy.AirplaneModeController; -import com.android.systemui.statusbar.policy.AutoRotateController; - -public class SettingsPanel extends LinearLayout implements View.OnClickListener { - static final String TAG = "SettingsPanel"; - - AirplaneModeController mAirplane; - AutoRotateController mRotate; - - public SettingsPanel(Context context, AttributeSet attrs) { - this(context, attrs, 0); - } - - public SettingsPanel(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - } - - @Override - protected void onFinishInflate() { - super.onFinishInflate(); - - final Context context = getContext(); - - mAirplane = new AirplaneModeController(context, - (CompoundButton)findViewById(R.id.airplane_checkbox)); - findViewById(R.id.network).setOnClickListener(this); - mRotate = new AutoRotateController(context, - (CompoundButton)findViewById(R.id.rotate_checkbox)); - findViewById(R.id.settings).setOnClickListener(this); - } - - @Override - protected void onDetachedFromWindow() { - super.onDetachedFromWindow(); - mAirplane.release(); - } - - public void onClick(View v) { - switch (v.getId()) { - case R.id.network: - onClickNetwork(); - break; - case R.id.settings: - onClickSettings(); - break; - } - } - - private StatusBarManager getStatusBarManager() { - return (StatusBarManager)getContext().getSystemService(Context.STATUS_BAR_SERVICE); - } - - // Network - // ---------------------------- - private void onClickNetwork() { - Slog.d(TAG, "onClickNetwork"); - } - - // Settings - // ---------------------------- - private void onClickSettings() { - Slog.d(TAG, "onClickSettings"); - getContext().startActivity(new Intent(Settings.ACTION_SETTINGS) - .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); - getStatusBarManager().collapse(); - } -} - diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java new file mode 100644 index 0000000..f9ba908 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java @@ -0,0 +1,99 @@ +/* + * 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. + */ + +package com.android.systemui.statusbar.tablet; + +import android.app.StatusBarManager; +import android.content.Context; +import android.content.Intent; +import android.provider.Settings; +import android.util.AttributeSet; +import android.util.Slog; +import android.widget.LinearLayout; +import android.view.View; +import android.widget.CompoundButton; +import android.widget.ImageView; +import android.widget.TextView; + +import com.android.systemui.R; +import com.android.systemui.statusbar.policy.AirplaneModeController; +import com.android.systemui.statusbar.policy.AutoRotateController; + +public class SettingsView extends LinearLayout implements View.OnClickListener { + static final String TAG = "SettingsView"; + + AirplaneModeController mAirplane; + AutoRotateController mRotate; + + public SettingsView(Context context, AttributeSet attrs) { + this(context, attrs, 0); + } + + public SettingsView(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + } + + @Override + protected void onFinishInflate() { + super.onFinishInflate(); + + final Context context = getContext(); + + mAirplane = new AirplaneModeController(context, + (CompoundButton)findViewById(R.id.airplane_checkbox)); + findViewById(R.id.network).setOnClickListener(this); + mRotate = new AutoRotateController(context, + (CompoundButton)findViewById(R.id.rotate_checkbox)); + findViewById(R.id.settings).setOnClickListener(this); + } + + @Override + protected void onDetachedFromWindow() { + super.onDetachedFromWindow(); + mAirplane.release(); + } + + public void onClick(View v) { + switch (v.getId()) { + case R.id.network: + onClickNetwork(); + break; + case R.id.settings: + onClickSettings(); + break; + } + } + + private StatusBarManager getStatusBarManager() { + return (StatusBarManager)getContext().getSystemService(Context.STATUS_BAR_SERVICE); + } + + // Network + // ---------------------------- + private void onClickNetwork() { + Slog.d(TAG, "onClickNetwork"); + } + + // Settings + // ---------------------------- + private void onClickSettings() { + Slog.d(TAG, "onClickSettings"); + getContext().startActivity(new Intent(Settings.ACTION_SETTINGS) + .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); + getStatusBarManager().collapse(); + } +} + diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java index 0cb9249..d1e61a9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java @@ -184,7 +184,7 @@ public class ShirtPocket extends FrameLayout { }; private void setupWindow() { - mWindow = View.inflate(getContext(), R.layout.sysbar_panel_pocket, null); + mWindow = View.inflate(getContext(), R.layout.status_bar_pocket_panel, null); mPreviewIcon = (ImageView) mWindow.findViewById(R.id.icon); mDescription = (TextView) mWindow.findViewById(R.id.description); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SystemPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SystemPanel.java deleted file mode 100644 index 41b44c2..0000000 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SystemPanel.java +++ /dev/null @@ -1,403 +0,0 @@ -/* - * 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. - */ - -package com.android.systemui.statusbar.tablet; - -import android.bluetooth.BluetoothAdapter; -import android.content.BroadcastReceiver; -import android.content.ContentResolver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.location.LocationManager; -import android.media.AudioManager; -import android.telephony.PhoneStateListener; -import android.telephony.ServiceState; -import android.os.IPowerManager; -import android.os.RemoteException; -import android.os.ServiceManager; -import android.provider.Settings; -import android.util.AttributeSet; -import android.util.Slog; -import android.view.View; -import android.view.IWindowManager; -import android.view.WindowManager; -import android.view.WindowManagerImpl; -import android.widget.ImageButton; -import android.widget.LinearLayout; -import android.widget.TextView; -import android.widget.Toast; - -import com.android.internal.telephony.IccCard; -import com.android.internal.telephony.TelephonyIntents; -import com.android.internal.telephony.cdma.EriInfo; -import com.android.internal.telephony.cdma.TtyIntent; - -import com.android.server.WindowManagerService; - -import com.android.systemui.statusbar.*; -import com.android.systemui.R; - -public class SystemPanel extends LinearLayout implements StatusBarPanel { - private static final String TAG = "SystemPanel"; - private static final boolean DEBUG = TabletStatusBar.DEBUG; - - private static final int MINIMUM_BACKLIGHT = android.os.Power.BRIGHTNESS_DIM + 5; - private static final int MAXIMUM_BACKLIGHT = android.os.Power.BRIGHTNESS_ON; - private static final int DEFAULT_BACKLIGHT = (int) (android.os.Power.BRIGHTNESS_ON * 0.4f); - - private TabletStatusBar mBar; - private boolean mAirplaneMode; - - private ImageButton mBrightnessButton; - private ImageButton mSoundButton; - private ImageButton mOrientationButton; - private ImageButton mAirplaneButton; - private ImageButton mGpsButton; - private ImageButton mBluetoothButton; - - private final IWindowManager mWM; - - private final AudioManager mAudioManager; - private final BluetoothAdapter mBluetoothAdapter; - - public boolean isInContentArea(int x, int y) { - final int l = getPaddingLeft(); - final int r = getWidth() - getPaddingRight(); - final int t = getPaddingTop(); - final int b = getHeight() - getPaddingBottom(); - return x >= l && x < r && y >= t && y < b; - } - - private BroadcastReceiver mReceiver = new BroadcastReceiver() { - @Override - public void onReceive(Context context, Intent intent) { - final String action = intent.getAction(); - if (action.equals(AudioManager.RINGER_MODE_CHANGED_ACTION)) { - refreshSound(); - } else if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) { - refreshBluetooth(); - } - } - }; - - public void setBar(TabletStatusBar bar) { - mBar = bar; - } - - public SystemPanel(Context context, AttributeSet attrs) { - this(context, attrs, 0); - } - - public SystemPanel(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - - // our mighty overlord - mWM = IWindowManager.Stub.asInterface( - ServiceManager.getService("window")); - - // audio status - mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); - - // Bluetooth - mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); - } - - public void onAttachedToWindow() { - TextView settingsButton = (TextView)findViewById(R.id.settings_button); - settingsButton.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - getContext().startActivity(new Intent(android.provider.Settings.ACTION_SETTINGS) - .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); - mBar.animateCollapse(); - }}); - - mBrightnessButton = (ImageButton)findViewById(R.id.brightness); - mBrightnessButton.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - rotateBrightness(); - } - }); - - mSoundButton = (ImageButton)findViewById(R.id.sound); - mSoundButton.setAlpha(getSilentMode() ? 0x7F : 0xFF); - mSoundButton.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - setSilentMode(!getSilentMode()); - mSoundButton.setAlpha(getSilentMode() ? 0x7F : 0xFF); - } - }); - mOrientationButton = (ImageButton)findViewById(R.id.orientation); - mOrientationButton.setImageResource( - getAutoRotate() - ? R.drawable.ic_sysbar_rotate_on - : R.drawable.ic_sysbar_rotate_off); - mOrientationButton.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - setAutoRotate(!getAutoRotate()); - mOrientationButton.setImageResource( - getAutoRotate() - ? R.drawable.ic_sysbar_rotate_on - : R.drawable.ic_sysbar_rotate_off); - Toast.makeText(getContext(), - getAutoRotate() - ? R.string.toast_rotation_free - : R.string.toast_rotation_locked, - Toast.LENGTH_SHORT).show(); - } - }); - - mAirplaneButton = (ImageButton)findViewById(R.id.airplane); - mAirplaneButton.setAlpha(mAirplaneMode ? 0xFF : 0x7F); - mAirplaneButton.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - boolean newMode = !getAirplaneMode(); - Toast.makeText(getContext(), "Attempting to turn " - + (newMode ? "on" : "off") + " airplane mode (flaky).", - Toast.LENGTH_SHORT).show(); - setAirplaneMode(newMode); - } - }); - - mGpsButton = (ImageButton)findViewById(R.id.gps); - mGpsButton.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - toggleGps(); - refreshGps(); - } - }); - - mBluetoothButton = (ImageButton)findViewById(R.id.bluetooth); - mBluetoothButton.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - toggleBluetooth(); - refreshBluetooth(); - } - }); - - // register for broadcasts - IntentFilter filter = new IntentFilter(); - filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION); - filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED); - getContext().registerReceiver(mReceiver, filter); - - refreshBluetooth(); - refreshGps(); - } - - public void onDetachedFromWindow() { - getContext().unregisterReceiver(mReceiver); - } - - // ---------------------------------------------------------------------- - -// private boolean isAutoBrightness() { -// Context context = getContext(); -// try { -// IPowerManager power = IPowerManager.Stub.asInterface( -// ServiceManager.getService("power")); -// if (power != null) { -// int brightnessMode = Settings.System.getInt(context.getContentResolver(), -// Settings.System.SCREEN_BRIGHTNESS_MODE); -// return brightnessMode == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC; -// } -// } catch (RemoteException e) { -// } catch (Settings.SettingNotFoundException e) { -// } -// return false; -// } - - private void rotateBrightness() { - int icon = R.drawable.ic_sysbar_brightness; - int bg = R.drawable.sysbar_toggle_bg_on; - Context context = getContext(); - try { - IPowerManager power = IPowerManager.Stub.asInterface( - ServiceManager.getService("power")); - if (power != null) { - ContentResolver cr = context.getContentResolver(); - int brightness = Settings.System.getInt(cr, - Settings.System.SCREEN_BRIGHTNESS); - int brightnessMode = Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL; - //Only get brightness setting if available - if (context.getResources().getBoolean( - com.android.internal.R.bool.config_automatic_brightness_available)) { - brightnessMode = Settings.System.getInt(cr, - Settings.System.SCREEN_BRIGHTNESS_MODE); - } - - // Rotate AUTO -> MINIMUM -> DEFAULT -> MAXIMUM - // Technically, not a toggle... - if (brightnessMode == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC) { - brightness = MINIMUM_BACKLIGHT; - icon = R.drawable.ic_sysbar_brightness_low; - brightnessMode = Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL; - } else if (brightness < DEFAULT_BACKLIGHT) { - brightness = DEFAULT_BACKLIGHT; - } else if (brightness < MAXIMUM_BACKLIGHT) { - brightness = MAXIMUM_BACKLIGHT; - } else { - brightnessMode = Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC; - brightness = MINIMUM_BACKLIGHT; - icon = R.drawable.ic_sysbar_brightness_auto; - } - - if (context.getResources().getBoolean( - com.android.internal.R.bool.config_automatic_brightness_available)) { - // Set screen brightness mode (automatic or manual) - Settings.System.putInt(context.getContentResolver(), - Settings.System.SCREEN_BRIGHTNESS_MODE, - brightnessMode); - } else { - // Make sure we set the brightness if automatic mode isn't available - brightnessMode = Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL; - } - if (brightnessMode == Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL) { - power.setBacklightBrightness(brightness); - Settings.System.putInt(cr, Settings.System.SCREEN_BRIGHTNESS, brightness); - } - } - } catch (RemoteException e) { - } catch (Settings.SettingNotFoundException e) { - } - - mBrightnessButton.setImageResource(icon); - mBrightnessButton.setBackgroundResource(bg); - } - - PhoneStateListener mPhoneStateListener = new PhoneStateListener() { - @Override - public void onServiceStateChanged(ServiceState serviceState) { - if (DEBUG) { - Slog.d(TAG, "phone service state changed: " + serviceState.getState()); - } - mAirplaneMode = serviceState.getState() == ServiceState.STATE_POWER_OFF; - if (mAirplaneButton != null) { - mAirplaneButton.setImageResource(mAirplaneMode - ? R.drawable.ic_sysbar_airplane_on - : R.drawable.ic_sysbar_airplane_off); - mAirplaneButton.setBackgroundResource(mAirplaneMode - ? R.drawable.sysbar_toggle_bg_on - : R.drawable.sysbar_toggle_bg_off); - } - } - }; - - private boolean getAirplaneMode() { - return mAirplaneMode; - } - - private void setAirplaneMode(boolean on) { - Settings.System.putInt( - mContext.getContentResolver(), - Settings.System.AIRPLANE_MODE_ON, - on ? 1 : 0); - Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED); - intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING); - intent.putExtra("state", on); - getContext().sendBroadcast(intent); - } - - boolean getSilentMode() { - return mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_NORMAL; - } - - void setSilentMode(boolean on) { - if (on) { - mAudioManager.setRingerMode((Settings.System.getInt(mContext.getContentResolver(), - Settings.System.VIBRATE_IN_SILENT, 1) == 1) - ? AudioManager.RINGER_MODE_VIBRATE - : AudioManager.RINGER_MODE_SILENT); - } else { - mAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL); - } - } - - void refreshSound() { - boolean silent = getSilentMode(); - mSoundButton.setImageResource(!silent - ? R.drawable.ic_sysbar_sound_on - : R.drawable.ic_sysbar_sound_off); - mSoundButton.setBackgroundResource(!silent - ? R.drawable.sysbar_toggle_bg_on - : R.drawable.sysbar_toggle_bg_off); - } - - void toggleBluetooth() { - if (mBluetoothAdapter == null) return; - if (mBluetoothAdapter.isEnabled()) { - mBluetoothAdapter.disable(); - } else { - mBluetoothAdapter.enable(); - } - } - - void refreshBluetooth() { - boolean on = mBluetoothAdapter != null && mBluetoothAdapter.isEnabled(); - mBluetoothButton.setImageResource(on ? R.drawable.ic_sysbar_bluetooth_on - : R.drawable.ic_sysbar_bluetooth_off); - mBluetoothButton.setBackgroundResource(on - ? R.drawable.sysbar_toggle_bg_on - : R.drawable.sysbar_toggle_bg_off); - } - - private boolean isGpsEnabled() { - ContentResolver res = mContext.getContentResolver(); - return Settings.Secure.isLocationProviderEnabled( - res, LocationManager.GPS_PROVIDER); - } - - private void toggleGps() { - Settings.Secure.setLocationProviderEnabled(mContext.getContentResolver(), - LocationManager.GPS_PROVIDER, !isGpsEnabled()); - } - - private void refreshGps() { - boolean on = isGpsEnabled(); - mGpsButton.setImageResource(on ? R.drawable.ic_sysbar_gps_on - : R.drawable.ic_sysbar_gps_off); - mGpsButton.setBackgroundResource(on - ? R.drawable.sysbar_toggle_bg_on - : R.drawable.sysbar_toggle_bg_off); - } - - void setAutoRotate(boolean rot) { - try { - ContentResolver cr = getContext().getContentResolver(); - if (rot) { - mWM.thawRotation(); - } else { - mWM.freezeRotation(); - } - } catch (RemoteException exc) { - } - } - - boolean getAutoRotate() { - ContentResolver cr = getContext().getContentResolver(); - return 1 == Settings.System.getInt(cr, - Settings.System.ACCELEROMETER_ROTATION, - 1); - } - - int getDisplayRotation() { - try { - return mWM.getRotation(); - } catch (RemoteException exc) { - return 0; - } - } -} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java index 6db5b2b..3b27992 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -145,11 +145,11 @@ public class TabletStatusBar extends StatusBar { final Resources res = context.getResources(); final int barHeight= res.getDimensionPixelSize( - com.android.internal.R.dimen.status_bar_height); + com.android.internal.R.dimen.status_bar_height); // Notification Panel mNotificationPanel = (NotificationPanel)View.inflate(context, - R.layout.sysbar_panel_notifications, null); + R.layout.status_bar_notification_panel, null); mNotificationPanel.setVisibility(View.GONE); mNotificationPanel.setOnTouchListener( new TouchOutsideListener(MSG_CLOSE_NOTIFICATION_PANEL, mNotificationPanel)); @@ -180,7 +180,7 @@ public class TabletStatusBar extends StatusBar { // Notification preview window mNotificationPeekWindow = (NotificationPeekPanel) View.inflate(context, - R.layout.sysbar_panel_notification_peek, null); + R.layout.status_bar_notification_peek, null); mNotificationPeekRow = (ViewGroup) mNotificationPeekWindow.findViewById(R.id.content); mNotificationPeekWindow.setVisibility(View.GONE); mNotificationPeekWindow.setOnTouchListener( @@ -216,8 +216,8 @@ public class TabletStatusBar extends StatusBar { // Recents Panel if (USE_2D_RECENTS) { - mRecentsPanel = (RecentAppsPanel) View.inflate(context, R.layout.sysbar_panel_recent, - null); + mRecentsPanel = (RecentAppsPanel) View.inflate(context, + R.layout.status_bar_recent_panel, null); mRecentsPanel.setVisibility(View.GONE); mRecentsPanel.setOnTouchListener(new TouchOutsideListener(MSG_CLOSE_RECENTS_PANEL, mRecentsPanel)); @@ -987,7 +987,7 @@ public class TabletStatusBar extends StatusBar { // create the row view LayoutInflater inflater = (LayoutInflater)mContext.getSystemService( Context.LAYOUT_INFLATER_SERVICE); - View row = inflater.inflate(R.layout.status_bar_latest_event, parent, false); + View row = inflater.inflate(R.layout.status_bar_notification_row, parent, false); workAroundBadLayerDrawableOpacity(row); View vetoButton = row.findViewById(R.id.veto); if (entry.notification.isClearable()) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java index b05fe1a..5a464f4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java @@ -187,7 +187,7 @@ public class TabletTicker extends Handler { iconId = R.id.left_icon; } if (n.tickerView != null) { - group = (ViewGroup)inflater.inflate(R.layout.ticker, null, false); + group = (ViewGroup)inflater.inflate(R.layout.status_bar_ticker_panel, null, false); View expanded = null; Exception exception = null; try { @@ -209,7 +209,7 @@ public class TabletTicker extends Handler { lp.gravity = Gravity.BOTTOM; group.addView(expanded, lp); } else if (n.tickerText != null) { - group = (ViewGroup)inflater.inflate(R.layout.ticker_compat, mWindow, false); + group = (ViewGroup)inflater.inflate(R.layout.status_bar_ticker_compat, mWindow, false); final Drawable icon = StatusBarIconView.getIcon(mContext, new StatusBarIcon(notification.pkg, n.icon, n.iconLevel, 0)); ImageView iv = (ImageView)group.findViewById(iconId); -- cgit v1.1