Redo power widget layout with the proper widget style.
The power widget now uses the fuzzy-edged widget background. It has a resonable layout in portrait and landscape. appwidget_inner is the background for a button on the inside, with a border on the left. appwidget_outer is the background for a button on the outside (i.e. leftmost); it does not have a border.
BIN
res/drawable-land/appwidget_bg.9.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
res/drawable/appwidget_bg.9.png
Normal file
After Width: | Height: | Size: 16 KiB |
@@ -17,17 +17,17 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_window_focused="false" android:state_enabled="true"
|
||||
android:drawable="@drawable/widget_btn_default" />
|
||||
android:drawable="@drawable/appwidget_inner_default" />
|
||||
|
||||
<item android:state_pressed="true"
|
||||
android:drawable="@drawable/widget_btn_pressed" />
|
||||
android:drawable="@drawable/appwidget_inner_pressed" />
|
||||
|
||||
<item android:state_focused="true" android:state_enabled="true"
|
||||
android:drawable="@drawable/widget_btn_selected" />
|
||||
android:drawable="@drawable/appwidget_inner_selected" />
|
||||
|
||||
<item android:state_enabled="true"
|
||||
android:drawable="@drawable/widget_btn_default" />
|
||||
android:drawable="@drawable/appwidget_inner_default" />
|
||||
|
||||
<item
|
||||
android:drawable="@drawable/widget_btn_default" />
|
||||
android:drawable="@drawable/appwidget_inner_default" />
|
||||
</selector>
|
BIN
res/drawable/appwidget_inner_default.9.png
Normal file
After Width: | Height: | Size: 179 B |
BIN
res/drawable/appwidget_inner_pressed.9.png
Normal file
After Width: | Height: | Size: 301 B |
BIN
res/drawable/appwidget_inner_selected.9.png
Normal file
After Width: | Height: | Size: 306 B |
33
res/drawable/appwidget_outer.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2009 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_window_focused="false" android:state_enabled="true"
|
||||
android:drawable="@drawable/appwidget_outer_default" />
|
||||
|
||||
<item android:state_pressed="true"
|
||||
android:drawable="@drawable/appwidget_outer_pressed" />
|
||||
|
||||
<item android:state_focused="true" android:state_enabled="true"
|
||||
android:drawable="@drawable/appwidget_outer_selected" />
|
||||
|
||||
<item android:state_enabled="true"
|
||||
android:drawable="@drawable/appwidget_outer_default" />
|
||||
|
||||
<item
|
||||
android:drawable="@drawable/appwidget_outer_default" />
|
||||
</selector>
|
BIN
res/drawable/appwidget_outer_default.9.png
Normal file
After Width: | Height: | Size: 179 B |
BIN
res/drawable/appwidget_outer_pressed.9.png
Normal file
After Width: | Height: | Size: 288 B |
BIN
res/drawable/appwidget_outer_selected.9.png
Normal file
After Width: | Height: | Size: 298 B |
Before Width: | Height: | Size: 777 B |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.6 KiB |
63
res/layout-land/widget.xml
Normal file
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2009 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:id="@+id/main"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/appwidget_bg" >
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_wifi"
|
||||
android:layout_width="79dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@drawable/appwidget_outer"
|
||||
android:layout_gravity="center_horizontal"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_bluetooth"
|
||||
android:layout_width="79dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@drawable/appwidget_inner"
|
||||
android:layout_gravity="center_horizontal"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_gps"
|
||||
android:layout_width="79dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@drawable/appwidget_inner"
|
||||
android:layout_gravity="center_horizontal"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_sync"
|
||||
android:layout_width="79dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@drawable/appwidget_inner"
|
||||
android:layout_gravity="center_horizontal"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_brightness"
|
||||
android:layout_width="78dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@drawable/appwidget_inner"
|
||||
android:layout_gravity="center_horizontal"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
@@ -16,62 +16,47 @@
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="4dip"
|
||||
android:paddingRight="4dip"
|
||||
android:paddingTop="7dip"
|
||||
android:paddingBottom="13dip"
|
||||
android:background="@drawable/widget_bg" >
|
||||
android:background="@drawable/appwidget_bg" >
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_wifi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="57dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_marginLeft="3dip"
|
||||
android:layout_marginRight="3dip"
|
||||
android:background="@drawable/widget_btn"
|
||||
android:background="@drawable/appwidget_outer"
|
||||
android:layout_gravity="center_horizontal"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_bluetooth"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="57dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_marginLeft="3dip"
|
||||
android:layout_marginRight="3dip"
|
||||
android:background="@drawable/widget_btn"
|
||||
android:background="@drawable/appwidget_inner"
|
||||
android:layout_gravity="center_horizontal"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_gps"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="57dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_marginLeft="3dip"
|
||||
android:layout_marginRight="3dip"
|
||||
android:background="@drawable/widget_btn"
|
||||
android:background="@drawable/appwidget_inner"
|
||||
android:layout_gravity="center_horizontal"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_sync"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="57dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_marginLeft="3dip"
|
||||
android:layout_marginRight="3dip"
|
||||
android:background="@drawable/widget_btn"
|
||||
android:background="@drawable/appwidget_inner"
|
||||
android:layout_gravity="center_horizontal"
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_brightness"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="58dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_marginLeft="3dip"
|
||||
android:layout_marginRight="3dip"
|
||||
android:background="@drawable/widget_btn"
|
||||
android:background="@drawable/appwidget_inner"
|
||||
android:layout_gravity="center_horizontal"
|
||||
/>
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
-->
|
||||
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:minWidth="219dip"
|
||||
android:minWidth="294dip"
|
||||
android:minHeight="72dip"
|
||||
android:initialLayout="@layout/widget"
|
||||
>
|
||||
|