am cfd48d77
: Merge "Rebuild quick settings tile layouts." into jb-mr2-dev
* commit 'cfd48d77a2d11324ce8641a9cc178fb9f12500a3': Rebuild quick settings tile layouts.
This commit is contained in:
@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2012 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.
|
|
||||||
-->
|
|
||||||
<TextView
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
style="@style/TextAppearance.QuickSettings.TileView"
|
|
||||||
android:id="@+id/airplane_mode_textview"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
/>
|
|
@ -15,11 +15,11 @@
|
|||||||
-->
|
-->
|
||||||
<TextView
|
<TextView
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
style="@style/TextAppearance.QuickSettings.TileView"
|
style="@style/TextAppearance.QuickSettings.TileView.AllInOne"
|
||||||
android:id="@+id/alarm_textview"
|
android:id="@+id/alarm_textview"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:drawableTop="@drawable/ic_qs_alarm_on"
|
android:drawableTop="@drawable/ic_qs_alarm_on"
|
||||||
/>
|
/>
|
||||||
|
39
packages/SystemUI/res/layout/quick_settings_tile_basic.xml
Normal file
39
packages/SystemUI/res/layout/quick_settings_tile_basic.xml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2013 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.
|
||||||
|
-->
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="top"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:layout_marginTop="@dimen/qs_tile_margin_above_icon"
|
||||||
|
android:layout_marginBottom="@dimen/qs_tile_margin_below_icon"
|
||||||
|
android:layout_width="@dimen/qs_tile_icon_size"
|
||||||
|
android:layout_height="@dimen/qs_tile_icon_size"
|
||||||
|
android:layout_gravity="top|center_horizontal"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
style="@style/TextAppearance.QuickSettings.TileView"
|
||||||
|
android:id="@+id/text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="top|center_horizontal"
|
||||||
|
android:gravity="top|center_horizontal"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Copyright (C) 2012 The Android Open Source Project
|
<!-- Copyright (C) 2013 The Android Open Source Project
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
@ -14,24 +14,26 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="top"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/battery_image"
|
android:id="@+id/image"
|
||||||
android:layout_width="wrap_content"
|
android:layout_marginTop="@dimen/qs_tile_margin_above_icon"
|
||||||
android:layout_height="wrap_content"
|
android:layout_marginBottom="@dimen/qs_tile_margin_below_icon"
|
||||||
android:layout_gravity="center"
|
android:layout_width="@dimen/qs_tile_icon_size"
|
||||||
android:paddingBottom="10dp"
|
android:layout_height="@dimen/qs_tile_icon_size"
|
||||||
/>
|
android:layout_gravity="top|center_horizontal"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
style="@style/TextAppearance.QuickSettings.TileView"
|
style="@style/TextAppearance.QuickSettings.TileView"
|
||||||
android:id="@+id/battery_textview"
|
android:id="@+id/text"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="top|center_horizontal"
|
||||||
android:gravity="center"
|
android:gravity="top|center_horizontal"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2012 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.
|
|
||||||
-->
|
|
||||||
<TextView
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
style="@style/TextAppearance.QuickSettings.TileView"
|
|
||||||
android:id="@+id/bluetooth_textview"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
/>
|
|
@ -1,25 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2012 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.
|
|
||||||
-->
|
|
||||||
<TextView
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
style="@style/TextAppearance.QuickSettings.TileView"
|
|
||||||
android:id="@+id/brightness_textview"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:drawableTop="@drawable/ic_qs_brightness_auto_off"
|
|
||||||
/>
|
|
@ -1,25 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2012 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.
|
|
||||||
-->
|
|
||||||
<TextView
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
style="@style/TextAppearance.QuickSettings.TileView"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:drawableTop="@*android:drawable/stat_sys_adb"
|
|
||||||
android:text="@*android:string/bugreport_title"
|
|
||||||
/>
|
|
@ -15,7 +15,7 @@
|
|||||||
-->
|
-->
|
||||||
<TextView
|
<TextView
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
style="@style/TextAppearance.QuickSettings.TileView"
|
style="@style/TextAppearance.QuickSettings.TileView.AllInOne"
|
||||||
android:id="@+id/ime_textview"
|
android:id="@+id/ime_textview"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -23,4 +23,4 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:drawableTop="@drawable/ic_qs_ime"
|
android:drawableTop="@drawable/ic_qs_ime"
|
||||||
android:text="@string/quick_settings_ime_label"
|
android:text="@string/quick_settings_ime_label"
|
||||||
/>
|
/>
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2012 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.
|
|
||||||
-->
|
|
||||||
<TextView
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
style="@style/TextAppearance.QuickSettings.TileView"
|
|
||||||
android:id="@+id/location_textview"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:drawableTop="@drawable/ic_qs_location"
|
|
||||||
android:text="@string/quick_settings_location_label"
|
|
||||||
/>
|
|
@ -15,10 +15,10 @@
|
|||||||
-->
|
-->
|
||||||
<TextView
|
<TextView
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
style="@style/TextAppearance.QuickSettings.TileView"
|
style="@style/TextAppearance.QuickSettings.TileView.AllInOne"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/quick_settings_media_device_label"
|
android:text="@string/quick_settings_media_device_label"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
/>
|
/>
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2012 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.
|
|
||||||
-->
|
|
||||||
<TextView
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
style="@style/TextAppearance.QuickSettings.TileView"
|
|
||||||
android:id="@+id/rotation_lock_textview"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
/>
|
|
@ -15,27 +15,28 @@
|
|||||||
-->
|
-->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="top"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_marginTop="@dimen/qs_tile_margin_above_icon"
|
||||||
android:layout_height="wrap_content"
|
android:layout_marginBottom="@dimen/qs_tile_margin_below_icon"
|
||||||
android:layout_gravity="center">
|
android:layout_width="@dimen/qs_tile_icon_size"
|
||||||
|
android:layout_height="@dimen/qs_tile_icon_size"
|
||||||
|
android:layout_gravity="top|center_horizontal"
|
||||||
|
>
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/rssi_image"
|
android:id="@+id/rssi_image"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:paddingBottom="10dp"
|
|
||||||
/>
|
/>
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/rssi_overlay_image"
|
android:id="@+id/rssi_overlay_image"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:paddingBottom="10dp"
|
|
||||||
/>
|
/>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
<TextView
|
<TextView
|
||||||
@ -43,8 +44,8 @@
|
|||||||
android:id="@+id/rssi_textview"
|
android:id="@+id/rssi_textview"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="top|center_horizontal"
|
||||||
android:gravity="center"
|
android:gravity="top|center_horizontal"
|
||||||
android:text="@string/quick_settings_rssi_label"
|
android:text="@string/quick_settings_rssi_label"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -1,25 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2012 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.
|
|
||||||
-->
|
|
||||||
<TextView
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
style="@style/TextAppearance.QuickSettings.TileView"
|
|
||||||
android:id="@+id/settings_tileview"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:drawableTop="@drawable/ic_qs_settings"
|
|
||||||
/>
|
|
@ -25,13 +25,12 @@
|
|||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
style="@style/TextAppearance.QuickSettings.TileView"
|
style="@style/TextAppearance.QuickSettings.TileView.User"
|
||||||
android:id="@+id/user_textview"
|
android:id="@+id/user_textview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal|bottom"
|
android:layout_gravity="center_horizontal|bottom"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/quick_settings_user_label"
|
android:text="@string/quick_settings_user_label"
|
||||||
android:background="#CC000000"
|
|
||||||
/>
|
/>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
@ -1,25 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2012 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.
|
|
||||||
-->
|
|
||||||
<TextView
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
style="@style/TextAppearance.QuickSettings.TileView"
|
|
||||||
android:id="@+id/wifi_textview"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/quick_settings_wifi_label"
|
|
||||||
/>
|
|
@ -1,26 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2012 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.
|
|
||||||
-->
|
|
||||||
<TextView
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
style="@style/TextAppearance.QuickSettings.TileView"
|
|
||||||
android:id="@+id/wifi_display_textview"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:drawableTop="@drawable/ic_qs_remote_display"
|
|
||||||
android:text="@string/quick_settings_wifi_display_label"
|
|
||||||
/>
|
|
@ -205,4 +205,11 @@
|
|||||||
<!-- How far to slide the panel out when you touch it -->
|
<!-- How far to slide the panel out when you touch it -->
|
||||||
<!-- For phones, this is close_handle_height + header_height -->
|
<!-- For phones, this is close_handle_height + header_height -->
|
||||||
<dimen name="peek_height">84dp</dimen>
|
<dimen name="peek_height">84dp</dimen>
|
||||||
|
|
||||||
|
<!-- Quick Settings tile geometry: top interior margin, above icon -->
|
||||||
|
<dimen name="qs_tile_margin_above_icon">27dp</dimen>
|
||||||
|
<!-- Quick Settings tile geometry: gap between icon and text -->
|
||||||
|
<dimen name="qs_tile_margin_below_icon">17dp</dimen>
|
||||||
|
<!-- Quick Settings tile geometry: icon size -->
|
||||||
|
<dimen name="qs_tile_icon_size">32dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -92,17 +92,20 @@
|
|||||||
<style name="TextAppearance.QuickSettings" />
|
<style name="TextAppearance.QuickSettings" />
|
||||||
|
|
||||||
<style name="TextAppearance.QuickSettings.TileView">
|
<style name="TextAppearance.QuickSettings.TileView">
|
||||||
<item name="android:paddingLeft">6dp</item>
|
|
||||||
<item name="android:paddingRight">6dp</item>
|
|
||||||
<item name="android:paddingBottom">2dp</item>
|
|
||||||
<item name="android:drawablePadding">12dp</item>
|
|
||||||
<item name="android:textSize">12dp</item>
|
<item name="android:textSize">12dp</item>
|
||||||
<item name="android:textStyle">normal</item>
|
<item name="android:textStyle">normal</item>
|
||||||
<item name="android:textColor">#CCCCCC</item>
|
<item name="android:textColor">#CCCCCC</item>
|
||||||
<item name="android:textAllCaps">true</item>
|
<item name="android:textAllCaps">true</item>
|
||||||
<item name="android:singleLine">true</item>
|
<item name="android:paddingStart">6dp</item>
|
||||||
<item name="android:ellipsize">marquee</item>
|
<item name="android:paddingEnd">6dp</item>
|
||||||
<item name="android:fadingEdge">horizontal</item>
|
</style>
|
||||||
|
|
||||||
|
<style name="TextAppearance.QuickSettings.TileView.AllInOne" parent="@style/TextAppearance.QuickSettings.TileView">
|
||||||
|
<item name="android:lines">2</item>
|
||||||
|
<item name="android:gravity">top</item>
|
||||||
|
<item name="android:paddingBottom">2dp</item>
|
||||||
|
<item name="android:paddingTop">16dp</item>
|
||||||
|
<item name="android:drawablePadding">8dp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TextAppearance.QuickSettings.Clock" parent="@style/TextAppearance.QuickSettings.TileView">
|
<style name="TextAppearance.QuickSettings.Clock" parent="@style/TextAppearance.QuickSettings.TileView">
|
||||||
@ -119,6 +122,13 @@
|
|||||||
<item name="android:textColor">#ff3a3b39</item>
|
<item name="android:textColor">#ff3a3b39</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="TextAppearance.QuickSettings.TileView.User" parent="@style/TextAppearance.QuickSettings.TileView">
|
||||||
|
<item name="android:background">#CC000000</item>
|
||||||
|
<item name="android:padding">4dp</item>
|
||||||
|
<item name="android:singleLine">true</item>
|
||||||
|
<item name="android:fadingEdge">horizontal</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="BaseBrightnessDialogContainer">
|
<style name="BaseBrightnessDialogContainer">
|
||||||
<item name="android:layout_width">match_parent</item>
|
<item name="android:layout_width">match_parent</item>
|
||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
package com.android.systemui.statusbar.phone;
|
package com.android.systemui.statusbar.phone;
|
||||||
|
|
||||||
import com.android.internal.view.RotationPolicy;
|
import com.android.internal.view.RotationPolicy;
|
||||||
import com.android.internal.widget.LockPatternUtils;
|
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
|
|
||||||
import com.android.systemui.statusbar.phone.QuickSettingsModel.BluetoothState;
|
import com.android.systemui.statusbar.phone.QuickSettingsModel.BluetoothState;
|
||||||
@ -38,7 +37,6 @@ import android.bluetooth.BluetoothAdapter;
|
|||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.CursorLoader;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.DialogInterface.OnClickListener;
|
import android.content.DialogInterface.OnClickListener;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@ -80,6 +78,7 @@ import java.util.ArrayList;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class QuickSettings {
|
class QuickSettings {
|
||||||
|
static final boolean DEBUG_GONE_TILES = false;
|
||||||
private static final String TAG = "QuickSettings";
|
private static final String TAG = "QuickSettings";
|
||||||
public static final boolean SHOW_IME_TILE = false;
|
public static final boolean SHOW_IME_TILE = false;
|
||||||
|
|
||||||
@ -271,6 +270,10 @@ class QuickSettings {
|
|||||||
startSettingsActivity(intent, true);
|
startSettingsActivity(intent, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void collapsePanels() {
|
||||||
|
getService().animateCollapsePanels();
|
||||||
|
}
|
||||||
|
|
||||||
private void startSettingsActivity(Intent intent, boolean onlyProvisioned) {
|
private void startSettingsActivity(Intent intent, boolean onlyProvisioned) {
|
||||||
if (onlyProvisioned && !getService().isDeviceProvisioned()) return;
|
if (onlyProvisioned && !getService().isDeviceProvisioned()) return;
|
||||||
try {
|
try {
|
||||||
@ -280,7 +283,7 @@ class QuickSettings {
|
|||||||
}
|
}
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
mContext.startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT));
|
mContext.startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT));
|
||||||
getService().animateCollapsePanels();
|
collapsePanels();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addUserTiles(ViewGroup parent, LayoutInflater inflater) {
|
private void addUserTiles(ViewGroup parent, LayoutInflater inflater) {
|
||||||
@ -290,7 +293,7 @@ class QuickSettings {
|
|||||||
userTile.setOnClickListener(new View.OnClickListener() {
|
userTile.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
mBar.collapseAllPanels(true);
|
collapsePanels();
|
||||||
final UserManager um = UserManager.get(mContext);
|
final UserManager um = UserManager.get(mContext);
|
||||||
if (um.getUsers(true).size() > 1) {
|
if (um.getUsers(true).size() > 1) {
|
||||||
try {
|
try {
|
||||||
@ -322,24 +325,18 @@ class QuickSettings {
|
|||||||
mDynamicSpannedTiles.add(userTile);
|
mDynamicSpannedTiles.add(userTile);
|
||||||
|
|
||||||
// Brightness
|
// Brightness
|
||||||
QuickSettingsTileView brightnessTile = (QuickSettingsTileView)
|
final QuickSettingsBasicTile brightnessTile
|
||||||
inflater.inflate(R.layout.quick_settings_tile, parent, false);
|
= new QuickSettingsBasicTile(mContext);
|
||||||
brightnessTile.setContent(R.layout.quick_settings_tile_brightness, inflater);
|
brightnessTile.setImageResource(R.drawable.ic_qs_brightness_auto_off);
|
||||||
brightnessTile.setOnClickListener(new View.OnClickListener() {
|
brightnessTile.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
mBar.collapseAllPanels(true);
|
collapsePanels();
|
||||||
showBrightnessDialog();
|
showBrightnessDialog();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mModel.addBrightnessTile(brightnessTile, new QuickSettingsModel.RefreshCallback() {
|
mModel.addBrightnessTile(brightnessTile,
|
||||||
@Override
|
new QuickSettingsModel.BasicRefreshCallback(brightnessTile));
|
||||||
public void refreshView(QuickSettingsTileView view, State state) {
|
|
||||||
TextView tv = (TextView) view.findViewById(R.id.brightness_textview);
|
|
||||||
tv.setCompoundDrawablesWithIntrinsicBounds(0, state.iconId, 0, 0);
|
|
||||||
tv.setText(state.label);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
parent.addView(brightnessTile);
|
parent.addView(brightnessTile);
|
||||||
mDynamicSpannedTiles.add(brightnessTile);
|
mDynamicSpannedTiles.add(brightnessTile);
|
||||||
|
|
||||||
@ -364,31 +361,24 @@ class QuickSettings {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Settings tile
|
// Settings tile
|
||||||
QuickSettingsTileView settingsTile = (QuickSettingsTileView)
|
final QuickSettingsBasicTile settingsTile = new QuickSettingsBasicTile(mContext);
|
||||||
inflater.inflate(R.layout.quick_settings_tile, parent, false);
|
settingsTile.setImageResource(R.drawable.ic_qs_settings);
|
||||||
settingsTile.setContent(R.layout.quick_settings_tile_settings, inflater);
|
|
||||||
settingsTile.setOnClickListener(new View.OnClickListener() {
|
settingsTile.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
startSettingsActivity(android.provider.Settings.ACTION_SETTINGS);
|
startSettingsActivity(android.provider.Settings.ACTION_SETTINGS);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mModel.addSettingsTile(settingsTile, new QuickSettingsModel.RefreshCallback() {
|
mModel.addSettingsTile(settingsTile,
|
||||||
@Override
|
new QuickSettingsModel.BasicRefreshCallback(settingsTile));
|
||||||
public void refreshView(QuickSettingsTileView view, State state) {
|
|
||||||
TextView tv = (TextView) view.findViewById(R.id.settings_tileview);
|
|
||||||
tv.setText(state.label);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
parent.addView(settingsTile);
|
parent.addView(settingsTile);
|
||||||
mDynamicSpannedTiles.add(settingsTile);
|
mDynamicSpannedTiles.add(settingsTile);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addSystemTiles(ViewGroup parent, LayoutInflater inflater) {
|
private void addSystemTiles(ViewGroup parent, LayoutInflater inflater) {
|
||||||
// Wi-fi
|
// Wi-fi
|
||||||
final QuickSettingsTileView wifiTile = (QuickSettingsTileView)
|
final QuickSettingsBasicTile wifiTile
|
||||||
inflater.inflate(R.layout.quick_settings_tile, parent, false);
|
= new QuickSettingsBasicTile(mContext);
|
||||||
wifiTile.setContent(R.layout.quick_settings_tile_wifi, inflater);
|
|
||||||
wifiTile.setOnClickListener(new View.OnClickListener() {
|
wifiTile.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -421,12 +411,11 @@ class QuickSettings {
|
|||||||
}
|
}
|
||||||
mModel.addWifiTile(wifiTile, new QuickSettingsModel.RefreshCallback() {
|
mModel.addWifiTile(wifiTile, new QuickSettingsModel.RefreshCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void refreshView(QuickSettingsTileView view, State state) {
|
public void refreshView(QuickSettingsTileView unused, State state) {
|
||||||
WifiState wifiState = (WifiState) state;
|
WifiState wifiState = (WifiState) state;
|
||||||
TextView tv = (TextView) view.findViewById(R.id.wifi_textview);
|
wifiTile.setImageResource(wifiState.iconId);
|
||||||
tv.setCompoundDrawablesWithIntrinsicBounds(0, wifiState.iconId, 0, 0);
|
wifiTile.setText(wifiState.label);
|
||||||
tv.setText(wifiState.label);
|
wifiTile.setContentDescription(mContext.getString(
|
||||||
view.setContentDescription(mContext.getString(
|
|
||||||
R.string.accessibility_quick_settings_wifi,
|
R.string.accessibility_quick_settings_wifi,
|
||||||
wifiState.signalContentDescription,
|
wifiState.signalContentDescription,
|
||||||
(wifiState.connected) ? wifiState.label : ""));
|
(wifiState.connected) ? wifiState.label : ""));
|
||||||
@ -476,10 +465,10 @@ class QuickSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Rotation Lock
|
// Rotation Lock
|
||||||
if (mContext.getResources().getBoolean(R.bool.quick_settings_show_rotation_lock)) {
|
if (mContext.getResources().getBoolean(R.bool.quick_settings_show_rotation_lock)
|
||||||
QuickSettingsTileView rotationLockTile = (QuickSettingsTileView)
|
|| DEBUG_GONE_TILES) {
|
||||||
inflater.inflate(R.layout.quick_settings_tile, parent, false);
|
final QuickSettingsBasicTile rotationLockTile
|
||||||
rotationLockTile.setContent(R.layout.quick_settings_tile_rotation_lock, inflater);
|
= new QuickSettingsBasicTile(mContext);
|
||||||
rotationLockTile.setOnClickListener(new View.OnClickListener() {
|
rotationLockTile.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -487,21 +476,13 @@ class QuickSettings {
|
|||||||
RotationPolicy.setRotationLock(mContext, !locked);
|
RotationPolicy.setRotationLock(mContext, !locked);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mModel.addRotationLockTile(rotationLockTile, new QuickSettingsModel.RefreshCallback() {
|
mModel.addRotationLockTile(rotationLockTile,
|
||||||
@Override
|
new QuickSettingsModel.BasicRefreshCallback(rotationLockTile));
|
||||||
public void refreshView(QuickSettingsTileView view, State state) {
|
|
||||||
TextView tv = (TextView) view.findViewById(R.id.rotation_lock_textview);
|
|
||||||
tv.setCompoundDrawablesWithIntrinsicBounds(0, state.iconId, 0, 0);
|
|
||||||
tv.setText(state.label);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
parent.addView(rotationLockTile);
|
parent.addView(rotationLockTile);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Battery
|
// Battery
|
||||||
QuickSettingsTileView batteryTile = (QuickSettingsTileView)
|
final QuickSettingsBasicTile batteryTile = new QuickSettingsBasicTile(mContext);
|
||||||
inflater.inflate(R.layout.quick_settings_tile, parent, false);
|
|
||||||
batteryTile.setContent(R.layout.quick_settings_tile_battery, inflater);
|
|
||||||
batteryTile.setOnClickListener(new View.OnClickListener() {
|
batteryTile.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -510,11 +491,9 @@ class QuickSettings {
|
|||||||
});
|
});
|
||||||
mModel.addBatteryTile(batteryTile, new QuickSettingsModel.RefreshCallback() {
|
mModel.addBatteryTile(batteryTile, new QuickSettingsModel.RefreshCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void refreshView(QuickSettingsTileView view, State state) {
|
public void refreshView(QuickSettingsTileView unused, State state) {
|
||||||
QuickSettingsModel.BatteryState batteryState =
|
QuickSettingsModel.BatteryState batteryState =
|
||||||
(QuickSettingsModel.BatteryState) state;
|
(QuickSettingsModel.BatteryState) state;
|
||||||
TextView tv = (TextView) view.findViewById(R.id.battery_textview);
|
|
||||||
ImageView iv = (ImageView) view.findViewById(R.id.battery_image);
|
|
||||||
Drawable d = batteryState.pluggedIn
|
Drawable d = batteryState.pluggedIn
|
||||||
? mChargingBatteryLevels
|
? mChargingBatteryLevels
|
||||||
: mBatteryLevels;
|
: mBatteryLevels;
|
||||||
@ -528,40 +507,38 @@ class QuickSettings {
|
|||||||
: mContext.getString(R.string.status_bar_settings_battery_meter_format,
|
: mContext.getString(R.string.status_bar_settings_battery_meter_format,
|
||||||
batteryState.batteryLevel);
|
batteryState.batteryLevel);
|
||||||
}
|
}
|
||||||
iv.setImageDrawable(d);
|
d.setLevel(batteryState.batteryLevel);
|
||||||
iv.setImageLevel(batteryState.batteryLevel);
|
batteryTile.setImageDrawable(d);
|
||||||
tv.setText(t);
|
batteryTile.setText(t);
|
||||||
view.setContentDescription(
|
batteryTile.setContentDescription(
|
||||||
mContext.getString(R.string.accessibility_quick_settings_battery, t));
|
mContext.getString(R.string.accessibility_quick_settings_battery, t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
parent.addView(batteryTile);
|
parent.addView(batteryTile);
|
||||||
|
|
||||||
// Airplane Mode
|
// Airplane Mode
|
||||||
QuickSettingsTileView airplaneTile = (QuickSettingsTileView)
|
final QuickSettingsBasicTile airplaneTile
|
||||||
inflater.inflate(R.layout.quick_settings_tile, parent, false);
|
= new QuickSettingsBasicTile(mContext);
|
||||||
airplaneTile.setContent(R.layout.quick_settings_tile_airplane, inflater);
|
|
||||||
mModel.addAirplaneModeTile(airplaneTile, new QuickSettingsModel.RefreshCallback() {
|
mModel.addAirplaneModeTile(airplaneTile, new QuickSettingsModel.RefreshCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void refreshView(QuickSettingsTileView view, State state) {
|
public void refreshView(QuickSettingsTileView unused, State state) {
|
||||||
TextView tv = (TextView) view.findViewById(R.id.airplane_mode_textview);
|
airplaneTile.setImageResource(state.iconId);
|
||||||
tv.setCompoundDrawablesWithIntrinsicBounds(0, state.iconId, 0, 0);
|
|
||||||
|
|
||||||
String airplaneState = mContext.getString(
|
String airplaneState = mContext.getString(
|
||||||
(state.enabled) ? R.string.accessibility_desc_on
|
(state.enabled) ? R.string.accessibility_desc_on
|
||||||
: R.string.accessibility_desc_off);
|
: R.string.accessibility_desc_off);
|
||||||
view.setContentDescription(
|
airplaneTile.setContentDescription(
|
||||||
mContext.getString(R.string.accessibility_quick_settings_airplane, airplaneState));
|
mContext.getString(R.string.accessibility_quick_settings_airplane, airplaneState));
|
||||||
tv.setText(state.label);
|
airplaneTile.setText(state.label);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
parent.addView(airplaneTile);
|
parent.addView(airplaneTile);
|
||||||
|
|
||||||
// Bluetooth
|
// Bluetooth
|
||||||
if (mModel.deviceSupportsBluetooth()) {
|
if (mModel.deviceSupportsBluetooth()
|
||||||
final QuickSettingsTileView bluetoothTile = (QuickSettingsTileView)
|
|| DEBUG_GONE_TILES) {
|
||||||
inflater.inflate(R.layout.quick_settings_tile, parent, false);
|
final QuickSettingsBasicTile bluetoothTile
|
||||||
bluetoothTile.setContent(R.layout.quick_settings_tile_bluetooth, inflater);
|
= new QuickSettingsBasicTile(mContext);
|
||||||
bluetoothTile.setOnClickListener(new View.OnClickListener() {
|
bluetoothTile.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -583,14 +560,12 @@ class QuickSettings {
|
|||||||
}
|
}
|
||||||
mModel.addBluetoothTile(bluetoothTile, new QuickSettingsModel.RefreshCallback() {
|
mModel.addBluetoothTile(bluetoothTile, new QuickSettingsModel.RefreshCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void refreshView(QuickSettingsTileView view, State state) {
|
public void refreshView(QuickSettingsTileView unused, State state) {
|
||||||
BluetoothState bluetoothState = (BluetoothState) state;
|
BluetoothState bluetoothState = (BluetoothState) state;
|
||||||
TextView tv = (TextView) view.findViewById(R.id.bluetooth_textview);
|
bluetoothTile.setImageResource(state.iconId);
|
||||||
tv.setCompoundDrawablesWithIntrinsicBounds(0, state.iconId, 0, 0);
|
|
||||||
|
|
||||||
Resources r = mContext.getResources();
|
|
||||||
String label = state.label;
|
|
||||||
/*
|
/*
|
||||||
|
Resources r = mContext.getResources();
|
||||||
//TODO: Show connected bluetooth device label
|
//TODO: Show connected bluetooth device label
|
||||||
Set<BluetoothDevice> btDevices =
|
Set<BluetoothDevice> btDevices =
|
||||||
mBluetoothController.getBondedBluetoothDevices();
|
mBluetoothController.getBondedBluetoothDevices();
|
||||||
@ -603,10 +578,10 @@ class QuickSettings {
|
|||||||
btDevices.size());
|
btDevices.size());
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
view.setContentDescription(mContext.getString(
|
bluetoothTile.setContentDescription(mContext.getString(
|
||||||
R.string.accessibility_quick_settings_bluetooth,
|
R.string.accessibility_quick_settings_bluetooth,
|
||||||
bluetoothState.stateContentDescription));
|
bluetoothState.stateContentDescription));
|
||||||
tv.setText(label);
|
bluetoothTile.setText(state.label);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
parent.addView(bluetoothTile);
|
parent.addView(bluetoothTile);
|
||||||
@ -616,9 +591,9 @@ class QuickSettings {
|
|||||||
|
|
||||||
private void addTemporaryTiles(final ViewGroup parent, final LayoutInflater inflater) {
|
private void addTemporaryTiles(final ViewGroup parent, final LayoutInflater inflater) {
|
||||||
// Alarm tile
|
// Alarm tile
|
||||||
QuickSettingsTileView alarmTile = (QuickSettingsTileView)
|
final QuickSettingsBasicTile alarmTile
|
||||||
inflater.inflate(R.layout.quick_settings_tile, parent, false);
|
= new QuickSettingsBasicTile(mContext);
|
||||||
alarmTile.setContent(R.layout.quick_settings_tile_alarm, inflater);
|
alarmTile.setImageResource(R.drawable.ic_qs_alarm_on);
|
||||||
alarmTile.setOnClickListener(new View.OnClickListener() {
|
alarmTile.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -632,94 +607,77 @@ class QuickSettings {
|
|||||||
});
|
});
|
||||||
mModel.addAlarmTile(alarmTile, new QuickSettingsModel.RefreshCallback() {
|
mModel.addAlarmTile(alarmTile, new QuickSettingsModel.RefreshCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void refreshView(QuickSettingsTileView view, State alarmState) {
|
public void refreshView(QuickSettingsTileView unused, State alarmState) {
|
||||||
TextView tv = (TextView) view.findViewById(R.id.alarm_textview);
|
alarmTile.setText(alarmState.label);
|
||||||
tv.setText(alarmState.label);
|
alarmTile.setVisibility(alarmState.enabled ? View.VISIBLE : View.GONE);
|
||||||
view.setVisibility(alarmState.enabled ? View.VISIBLE : View.GONE);
|
alarmTile.setContentDescription(mContext.getString(
|
||||||
view.setContentDescription(mContext.getString(
|
|
||||||
R.string.accessibility_quick_settings_alarm, alarmState.label));
|
R.string.accessibility_quick_settings_alarm, alarmState.label));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
parent.addView(alarmTile);
|
parent.addView(alarmTile);
|
||||||
|
|
||||||
// Location
|
// Location
|
||||||
QuickSettingsTileView locationTile = (QuickSettingsTileView)
|
final QuickSettingsBasicTile locationTile
|
||||||
inflater.inflate(R.layout.quick_settings_tile, parent, false);
|
= new QuickSettingsBasicTile(mContext);
|
||||||
locationTile.setContent(R.layout.quick_settings_tile_location, inflater);
|
locationTile.setImageResource(R.drawable.ic_qs_location);
|
||||||
|
locationTile.setTextResource(R.string.quick_settings_location_label);
|
||||||
locationTile.setOnClickListener(new View.OnClickListener() {
|
locationTile.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
startSettingsActivity(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
|
startSettingsActivity(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mModel.addLocationTile(locationTile, new QuickSettingsModel.RefreshCallback() {
|
mModel.addLocationTile(locationTile,
|
||||||
@Override
|
new QuickSettingsModel.BasicRefreshCallback(locationTile)
|
||||||
public void refreshView(QuickSettingsTileView view, State state) {
|
.setShowWhenEnabled(true));
|
||||||
TextView tv = (TextView) view.findViewById(R.id.location_textview);
|
|
||||||
tv.setText(state.label);
|
|
||||||
view.setVisibility(state.enabled ? View.VISIBLE : View.GONE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
parent.addView(locationTile);
|
parent.addView(locationTile);
|
||||||
|
|
||||||
// Wifi Display
|
// Wifi Display
|
||||||
QuickSettingsTileView wifiDisplayTile = (QuickSettingsTileView)
|
QuickSettingsBasicTile wifiDisplayTile
|
||||||
inflater.inflate(R.layout.quick_settings_tile, parent, false);
|
= new QuickSettingsBasicTile(mContext);
|
||||||
wifiDisplayTile.setContent(R.layout.quick_settings_tile_wifi_display, inflater);
|
wifiDisplayTile.setImageResource(R.drawable.ic_qs_remote_display);
|
||||||
wifiDisplayTile.setOnClickListener(new View.OnClickListener() {
|
wifiDisplayTile.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
startSettingsActivity(android.provider.Settings.ACTION_WIFI_DISPLAY_SETTINGS);
|
startSettingsActivity(android.provider.Settings.ACTION_WIFI_DISPLAY_SETTINGS);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mModel.addWifiDisplayTile(wifiDisplayTile, new QuickSettingsModel.RefreshCallback() {
|
mModel.addWifiDisplayTile(wifiDisplayTile,
|
||||||
@Override
|
new QuickSettingsModel.BasicRefreshCallback(wifiDisplayTile)
|
||||||
public void refreshView(QuickSettingsTileView view, State state) {
|
.setShowWhenEnabled(true));
|
||||||
TextView tv = (TextView) view.findViewById(R.id.wifi_display_textview);
|
|
||||||
tv.setText(state.label);
|
|
||||||
tv.setCompoundDrawablesWithIntrinsicBounds(0, state.iconId, 0, 0);
|
|
||||||
view.setVisibility(state.enabled ? View.VISIBLE : View.GONE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
parent.addView(wifiDisplayTile);
|
parent.addView(wifiDisplayTile);
|
||||||
|
|
||||||
if (SHOW_IME_TILE) {
|
if (SHOW_IME_TILE || DEBUG_GONE_TILES) {
|
||||||
// IME
|
// IME
|
||||||
QuickSettingsTileView imeTile = (QuickSettingsTileView)
|
final QuickSettingsBasicTile imeTile
|
||||||
inflater.inflate(R.layout.quick_settings_tile, parent, false);
|
= new QuickSettingsBasicTile(mContext);
|
||||||
imeTile.setContent(R.layout.quick_settings_tile_ime, inflater);
|
imeTile.setImageResource(R.drawable.ic_qs_ime);
|
||||||
imeTile.setOnClickListener(new View.OnClickListener() {
|
imeTile.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
try {
|
try {
|
||||||
mBar.collapseAllPanels(true);
|
collapsePanels();
|
||||||
Intent intent = new Intent(Settings.ACTION_SHOW_INPUT_METHOD_PICKER);
|
Intent intent = new Intent(Settings.ACTION_SHOW_INPUT_METHOD_PICKER);
|
||||||
PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, intent, 0);
|
PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, intent, 0);
|
||||||
pendingIntent.send();
|
pendingIntent.send();
|
||||||
} catch (Exception e) {}
|
} catch (Exception e) {}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mModel.addImeTile(imeTile, new QuickSettingsModel.RefreshCallback() {
|
mModel.addImeTile(imeTile,
|
||||||
@Override
|
new QuickSettingsModel.BasicRefreshCallback(imeTile)
|
||||||
public void refreshView(QuickSettingsTileView view, State state) {
|
.setShowWhenEnabled(true));
|
||||||
TextView tv = (TextView) view.findViewById(R.id.ime_textview);
|
|
||||||
if (state.label != null) {
|
|
||||||
tv.setText(state.label);
|
|
||||||
}
|
|
||||||
view.setVisibility(state.enabled ? View.VISIBLE : View.GONE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
parent.addView(imeTile);
|
parent.addView(imeTile);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bug reports
|
// Bug reports
|
||||||
QuickSettingsTileView bugreportTile = (QuickSettingsTileView)
|
final QuickSettingsBasicTile bugreportTile
|
||||||
inflater.inflate(R.layout.quick_settings_tile, parent, false);
|
= new QuickSettingsBasicTile(mContext);
|
||||||
bugreportTile.setContent(R.layout.quick_settings_tile_bugreport, inflater);
|
bugreportTile.setImageResource(com.android.internal.R.drawable.stat_sys_adb);
|
||||||
|
bugreportTile.setTextResource(com.android.internal.R.string.bugreport_title);
|
||||||
bugreportTile.setOnClickListener(new View.OnClickListener() {
|
bugreportTile.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
mBar.collapseAllPanels(true);
|
collapsePanels();
|
||||||
showBugreportDialog();
|
showBugreportDialog();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2013 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.phone;
|
||||||
|
|
||||||
|
import com.android.systemui.R;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
class QuickSettingsBasicTile extends QuickSettingsTileView {
|
||||||
|
private final TextView mTextView;
|
||||||
|
private final ImageView mImageView;
|
||||||
|
|
||||||
|
public QuickSettingsBasicTile(Context context) {
|
||||||
|
this(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public QuickSettingsBasicTile(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
|
||||||
|
setLayoutParams(new FrameLayout.LayoutParams(
|
||||||
|
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||||
|
context.getResources().getDimensionPixelSize(R.dimen.quick_settings_cell_height)
|
||||||
|
));
|
||||||
|
setBackgroundResource(R.drawable.qs_tile_background);
|
||||||
|
addView(LayoutInflater.from(context).inflate(
|
||||||
|
R.layout.quick_settings_tile_basic, null),
|
||||||
|
new FrameLayout.LayoutParams(
|
||||||
|
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||||
|
FrameLayout.LayoutParams.MATCH_PARENT));
|
||||||
|
mTextView = (TextView) findViewById(R.id.text);
|
||||||
|
mImageView = (ImageView) findViewById(R.id.image);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
void setContent(int layoutId, LayoutInflater inflater) {
|
||||||
|
throw new RuntimeException("why?");
|
||||||
|
}
|
||||||
|
|
||||||
|
public ImageView getImageView() {
|
||||||
|
return mImageView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TextView getTextView() {
|
||||||
|
return mTextView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImageDrawable(Drawable drawable) {
|
||||||
|
mImageView.setImageDrawable(drawable);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImageResource(int resId) {
|
||||||
|
mImageView.setImageResource(resId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setText(CharSequence text) {
|
||||||
|
mTextView.setText(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTextResource(int resId) {
|
||||||
|
mTextView.setText(resId);
|
||||||
|
}
|
||||||
|
}
|
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.android.systemui.statusbar.phone;
|
package com.android.systemui.statusbar.phone;
|
||||||
|
|
||||||
import android.app.ActivityManager;
|
|
||||||
import android.bluetooth.BluetoothAdapter;
|
import android.bluetooth.BluetoothAdapter;
|
||||||
import android.bluetooth.BluetoothAdapter.BluetoothStateChangeCallback;
|
import android.bluetooth.BluetoothAdapter.BluetoothStateChangeCallback;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
@ -96,6 +95,31 @@ class QuickSettingsModel implements BluetoothStateChangeCallback,
|
|||||||
public void refreshView(QuickSettingsTileView view, State state);
|
public void refreshView(QuickSettingsTileView view, State state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class BasicRefreshCallback implements RefreshCallback {
|
||||||
|
private final QuickSettingsBasicTile mView;
|
||||||
|
private boolean mShowWhenEnabled;
|
||||||
|
|
||||||
|
public BasicRefreshCallback(QuickSettingsBasicTile v) {
|
||||||
|
mView = v;
|
||||||
|
}
|
||||||
|
public void refreshView(QuickSettingsTileView ignored, State state) {
|
||||||
|
if (mShowWhenEnabled) {
|
||||||
|
mView.setVisibility(state.enabled ? View.VISIBLE : View.GONE);
|
||||||
|
}
|
||||||
|
if (state.iconId != 0) {
|
||||||
|
mView.setImageDrawable(null); // needed to flush any cached IDs
|
||||||
|
mView.setImageResource(state.iconId);
|
||||||
|
}
|
||||||
|
if (state.label != null) {
|
||||||
|
mView.setText(state.label);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public BasicRefreshCallback setShowWhenEnabled(boolean swe) {
|
||||||
|
mShowWhenEnabled = swe;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Broadcast receive to determine if there is an alarm set. */
|
/** Broadcast receive to determine if there is an alarm set. */
|
||||||
private BroadcastReceiver mAlarmIntentReceiver = new BroadcastReceiver() {
|
private BroadcastReceiver mAlarmIntentReceiver = new BroadcastReceiver() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -19,6 +19,7 @@ package com.android.systemui.statusbar.phone;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -28,7 +29,6 @@ class QuickSettingsTileView extends FrameLayout {
|
|||||||
|
|
||||||
private int mColSpan;
|
private int mColSpan;
|
||||||
private int mRowSpan;
|
private int mRowSpan;
|
||||||
private int mCellWidth;
|
|
||||||
|
|
||||||
public QuickSettingsTileView(Context context, AttributeSet attrs) {
|
public QuickSettingsTileView(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
@ -48,4 +48,19 @@ class QuickSettingsTileView extends FrameLayout {
|
|||||||
void setContent(int layoutId, LayoutInflater inflater) {
|
void setContent(int layoutId, LayoutInflater inflater) {
|
||||||
inflater.inflate(layoutId, this);
|
inflater.inflate(layoutId, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setVisibility(int vis) {
|
||||||
|
if (QuickSettings.DEBUG_GONE_TILES) {
|
||||||
|
if (vis == View.GONE) {
|
||||||
|
vis = View.VISIBLE;
|
||||||
|
setAlpha(0.25f);
|
||||||
|
setEnabled(false);
|
||||||
|
} else {
|
||||||
|
setAlpha(1f);
|
||||||
|
setEnabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.setVisibility(vis);
|
||||||
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user