summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/qs/QSPanel.java')
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSPanel.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index 1cdaeb8..7d9b48b 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -47,6 +47,7 @@ import com.android.systemui.statusbar.policy.BrightnessMirrorController;
import java.util.ArrayList;
import java.util.Collection;
+import cyanogenmod.app.StatusBarPanelCustomTile;
import cyanogenmod.providers.CMSettings;
/** View that represents the quick settings tile panel. **/
@@ -56,6 +57,7 @@ public class QSPanel extends ViewGroup {
protected final ArrayList<TileRecord> mRecords = new ArrayList<>();
protected View mDetail;
protected ViewGroup mDetailContent;
+ protected TextView mDetailRemoveButton;
protected TextView mDetailSettingsButton;
protected TextView mDetailDoneButton;
protected View mBrightnessView;
@@ -96,6 +98,7 @@ public class QSPanel extends ViewGroup {
protected void setupViews() {
mDetail = LayoutInflater.from(mContext).inflate(R.layout.qs_detail, this, false);
mDetailContent = (ViewGroup) mDetail.findViewById(android.R.id.content);
+ mDetailRemoveButton = (TextView) mDetail.findViewById(android.R.id.button3);
mDetailSettingsButton = (TextView) mDetail.findViewById(android.R.id.button2);
mDetailDoneButton = (TextView) mDetail.findViewById(android.R.id.button1);
updateDetailText();
@@ -146,6 +149,7 @@ public class QSPanel extends ViewGroup {
protected void updateDetailText() {
mDetailDoneButton.setText(R.string.quick_settings_done);
mDetailSettingsButton.setText(R.string.quick_settings_more_settings);
+ mDetailRemoveButton.setText(R.string.quick_settings_remove);
}
public void setBrightnessMirror(BrightnessMirrorController c) {
@@ -197,6 +201,7 @@ public class QSPanel extends ViewGroup {
super.onConfigurationChanged(newConfig);
FontSizeUtils.updateFontSize(mDetailDoneButton, R.dimen.qs_detail_button_text_size);
FontSizeUtils.updateFontSize(mDetailSettingsButton, R.dimen.qs_detail_button_text_size);
+ FontSizeUtils.updateFontSize(mDetailRemoveButton, R.dimen.qs_detail_button_text_size);
// We need to poke the detail views as well as they might not be attached to the view
// hierarchy but reused at a later point.
@@ -422,6 +427,16 @@ public class QSPanel extends ViewGroup {
}
});
+ final StatusBarPanelCustomTile customTile = detailAdapter.getCustomTile();
+ mDetailRemoveButton.setVisibility(customTile != null ? VISIBLE : GONE);
+ mDetailRemoveButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mHost.collapsePanels();
+ mHost.removeCustomTile(customTile);
+ }
+ });
+
mDetailContent.removeAllViews();
mDetail.bringToFront();
mDetailContent.addView(r.detailView);