Merge change I2abbb876 into eclair

* changes:
  New widgets
This commit is contained in:
Android (Google) Code Review
2009-10-28 03:16:41 -04:00
99 changed files with 216 additions and 139 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 932 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 793 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 847 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 885 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -16,18 +16,13 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/appwidget_inner_default" />
<item android:state_pressed="true"
android:drawable="@drawable/appwidget_inner_pressed" />
android:drawable="@drawable/appwidget_inner_press_c" />
<item android:state_focused="true" android:state_enabled="true"
android:drawable="@drawable/appwidget_inner_selected" />
<item android:state_enabled="true"
android:drawable="@drawable/appwidget_inner_default" />
android:state_window_focused="true"
android:drawable="@drawable/appwidget_inner_focus_c" />
<item
android:drawable="@drawable/appwidget_inner_default" />
android:drawable="@android:color/transparent" />
</selector>

View File

@@ -16,18 +16,13 @@
<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" />
android:drawable="@drawable/appwidget_inner_press_l" />
<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" />
android:state_window_focused="true"
android:drawable="@drawable/appwidget_inner_focus_l" />
<item
android:drawable="@drawable/appwidget_outer_default" />
android:drawable="@android:color/transparent" />
</selector>

View File

@@ -0,0 +1,28 @@
<?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_pressed="true"
android:drawable="@drawable/appwidget_inner_press_r" />
<item android:state_focused="true" android:state_enabled="true"
android:state_window_focused="true"
android:drawable="@drawable/appwidget_inner_focus_r" />
<item
android:drawable="@android:color/transparent" />
</selector>

View File

@@ -1,64 +0,0 @@
<?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="@dimen/appwidget_width"
android:layout_height="@dimen/appwidget_height"
android:gravity="center"
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="79dip"
android:layout_height="fill_parent"
android:background="@drawable/appwidget_inner"
android:layout_gravity="center_horizontal"
/>
</LinearLayout>

View File

@@ -14,51 +14,166 @@
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:layout_width="@dimen/appwidget_width"
android:layout_height="@dimen/appwidget_height"
android:gravity="center"
android:background="@drawable/appwidget_bg" >
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:background="@drawable/appwidget_bg" >
<ImageButton
android:id="@+id/btn_wifi"
android:layout_width="57dip"
android:layout_height="fill_parent"
android:background="@drawable/appwidget_outer"
android:layout_gravity="center_horizontal"
<LinearLayout
android:id="@+id/btn_wifi"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="fill_parent"
android:background="@drawable/appwidget_button_left"
android:clickable="true"
android:focusable="true"
android:orientation="vertical">
<ImageView
android:id="@+id/img_wifi"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:scaleType="center"
/>
<ImageView
android:id="@+id/ind_wifi"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
/>
</LinearLayout>
<ImageView
android:layout_width="1dip"
android:layout_height="fill_parent"
android:background="@drawable/appwidget_settings_divider"
/>
<ImageButton
android:id="@+id/btn_bluetooth"
android:layout_width="57dip"
android:layout_height="fill_parent"
android:background="@drawable/appwidget_inner"
android:layout_gravity="center_horizontal"
/>
<LinearLayout
android:id="@+id/btn_bluetooth"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="fill_parent"
android:background="@drawable/appwidget_button_center"
android:clickable="true"
android:focusable="true"
android:orientation="vertical">
<ImageButton
android:id="@+id/btn_gps"
android:layout_width="57dip"
android:layout_height="fill_parent"
android:background="@drawable/appwidget_inner"
android:layout_gravity="center_horizontal"
/>
<ImageView
android:id="@+id/img_bluetooth"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:scaleType="center"
/>
<ImageButton
android:id="@+id/btn_sync"
android:layout_width="57dip"
android:layout_height="fill_parent"
android:background="@drawable/appwidget_inner"
android:layout_gravity="center_horizontal"
/>
<ImageButton
android:id="@+id/btn_brightness"
android:layout_width="57dip"
android:layout_height="fill_parent"
android:background="@drawable/appwidget_inner"
android:layout_gravity="center_horizontal"
/>
<ImageView
android:id="@+id/ind_bluetooth"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
/>
</LinearLayout>
<ImageView
android:layout_width="1dip"
android:layout_height="fill_parent"
android:background="@drawable/appwidget_settings_divider"
/>
<LinearLayout
android:id="@+id/btn_gps"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="fill_parent"
android:background="@drawable/appwidget_button_center"
android:clickable="true"
android:focusable="true"
android:orientation="vertical">
<ImageView
android:id="@+id/img_gps"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:scaleType="center"
/>
<ImageView
android:id="@+id/ind_gps"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
/>
</LinearLayout>
<ImageView
android:layout_width="1dip"
android:layout_height="fill_parent"
android:background="@drawable/appwidget_settings_divider"
/>
<LinearLayout
android:id="@+id/btn_sync"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="fill_parent"
android:background="@drawable/appwidget_button_center"
android:clickable="true"
android:focusable="true"
android:orientation="vertical">
<ImageView
android:id="@+id/img_sync"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:scaleType="center"
/>
<ImageView
android:id="@+id/ind_sync"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
/>
</LinearLayout>
<ImageView
android:layout_width="1dip"
android:layout_height="fill_parent"
android:background="@drawable/appwidget_settings_divider"
/>
<LinearLayout
android:id="@+id/btn_brightness"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="fill_parent"
android:background="@drawable/appwidget_button_right"
android:clickable="true"
android:focusable="true"
android:orientation="vertical">
<ImageView
android:id="@+id/img_brightness"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:scaleType="center"
/>
<ImageView
android:id="@+id/ind_brightness"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
/>
</LinearLayout>
</LinearLayout>

View File

@@ -18,7 +18,4 @@
<dimen name="vpn_connect_margin_right">10sp</dimen>
<dimen name="vpn_connect_normal_text_size">16sp</dimen>
<dimen name="vpn_connect_input_box_label_width">90sp</dimen>
<dimen name="appwidget_width">311dip</dimen>
<dimen name="appwidget_height">80dip</dimen>
</resources>

View File

@@ -144,40 +144,51 @@ public class SettingsAppWidgetProvider extends AppWidgetProvider {
private static void updateButtons(RemoteViews views, Context context) {
switch (getWifiState(context)) {
case STATE_DISABLED:
views.setImageViewResource(R.id.btn_wifi, R.drawable.widget_btn_wifi_off);
views.setImageViewResource(R.id.img_wifi, R.drawable.ic_appwidget_settings_wifi_off);
views.setImageViewResource(R.id.ind_wifi, R.drawable.appwidget_settings_ind_off_l);
break;
case STATE_ENABLED:
views.setImageViewResource(R.id.btn_wifi, R.drawable.widget_btn_wifi);
views.setImageViewResource(R.id.img_wifi, R.drawable.ic_appwidget_settings_wifi_on);
views.setImageViewResource(R.id.ind_wifi, R.drawable.appwidget_settings_ind_on_l);
break;
case STATE_INTERMEDIATE:
views.setImageViewResource(R.id.btn_wifi, R.drawable.widget_btn_wifi_gray);
views.setImageViewResource(R.id.img_wifi, R.drawable.ic_appwidget_settings_wifi_off);
views.setImageViewResource(R.id.ind_wifi, R.drawable.appwidget_settings_ind_mid_l);
break;
}
if (getBrightness(context)) {
views.setImageViewResource(R.id.btn_brightness, R.drawable.widget_btn_brightness);
views.setImageViewResource(R.id.img_brightness, R.drawable.ic_appwidget_settings_brightness_on);
views.setImageViewResource(R.id.ind_brightness, R.drawable.appwidget_settings_ind_on_r);
} else {
views.setImageViewResource(R.id.btn_brightness, R.drawable.widget_btn_brightness_off);
views.setImageViewResource(R.id.img_brightness, R.drawable.ic_appwidget_settings_brightness_off);
views.setImageViewResource(R.id.ind_brightness, R.drawable.appwidget_settings_ind_off_r);
}
if (getSync(context)) {
views.setImageViewResource(R.id.btn_sync, R.drawable.widget_btn_sync);
views.setImageViewResource(R.id.img_sync, R.drawable.ic_appwidget_settings_sync_on);
views.setImageViewResource(R.id.ind_sync, R.drawable.appwidget_settings_ind_on_c);
} else {
views.setImageViewResource(R.id.btn_sync, R.drawable.widget_btn_sync_off);
views.setImageViewResource(R.id.img_sync, R.drawable.ic_appwidget_settings_sync_off);
views.setImageViewResource(R.id.ind_sync, R.drawable.appwidget_settings_ind_off_c);
}
if (getGpsState(context)) {
views.setImageViewResource(R.id.btn_gps, R.drawable.widget_btn_gps);
views.setImageViewResource(R.id.img_gps, R.drawable.ic_appwidget_settings_gps_on);
views.setImageViewResource(R.id.ind_gps, R.drawable.appwidget_settings_ind_on_c);
} else {
views.setImageViewResource(R.id.btn_gps, R.drawable.widget_btn_gps_off);
views.setImageViewResource(R.id.img_gps, R.drawable.ic_appwidget_settings_gps_off);
views.setImageViewResource(R.id.ind_gps, R.drawable.appwidget_settings_ind_off_c);
}
switch (getBluetoothState(context)) {
case STATE_DISABLED:
views.setImageViewResource(R.id.btn_bluetooth, R.drawable.widget_btn_bluetooth_off);
views.setImageViewResource(R.id.img_bluetooth, R.drawable.ic_appwidget_settings_bluetooth_off);
views.setImageViewResource(R.id.ind_bluetooth, R.drawable.appwidget_settings_ind_off_c);
break;
case STATE_ENABLED:
views.setImageViewResource(R.id.btn_bluetooth, R.drawable.widget_btn_bluetooth);
views.setImageViewResource(R.id.img_bluetooth, R.drawable.ic_appwidget_settings_bluetooth_on);
views.setImageViewResource(R.id.ind_bluetooth, R.drawable.appwidget_settings_ind_on_c);
break;
case STATE_INTERMEDIATE:
views.setImageViewResource(R.id.btn_bluetooth,
R.drawable.widget_btn_bluetooth_gray);
views.setImageViewResource(R.id.img_bluetooth, R.drawable.ic_appwidget_settings_bluetooth_off);
views.setImageViewResource(R.id.ind_bluetooth, R.drawable.appwidget_settings_ind_mid_c);
break;
}
}