diff options
author | Nicolas Roard <nicolas@android.com> | 2009-09-30 16:54:34 +0100 |
---|---|---|
committer | Nicolas Roard <nicolas@android.com> | 2009-09-30 16:54:34 +0100 |
commit | 9cdaba5e3f22fe9bdfc3b89c45e71d7497f5e9da (patch) | |
tree | 336495eced715afc2eafb44cc1e621a8205cbaf8 | |
parent | 9957024e9a4c904c83d76df03c4ebf9bdaa5f4c6 (diff) | |
download | packages_apps_Browser-9cdaba5e3f22fe9bdfc3b89c45e71d7497f5e9da.zip packages_apps_Browser-9cdaba5e3f22fe9bdfc3b89c45e71d7497f5e9da.tar.gz packages_apps_Browser-9cdaba5e3f22fe9bdfc3b89c45e71d7497f5e9da.tar.bz2 |
New assets for settings
17 files changed, 40 insertions, 33 deletions
diff --git a/res/drawable-hdpi/ic_list_data_large.png b/res/drawable-hdpi/ic_list_data_large.png Binary files differnew file mode 100644 index 0000000..aaa035d --- /dev/null +++ b/res/drawable-hdpi/ic_list_data_large.png diff --git a/res/drawable-hdpi/ic_list_data_off.png b/res/drawable-hdpi/ic_list_data_off.png Binary files differnew file mode 100644 index 0000000..f7eb6af --- /dev/null +++ b/res/drawable-hdpi/ic_list_data_off.png diff --git a/res/drawable-hdpi/ic_list_data_small.png b/res/drawable-hdpi/ic_list_data_small.png Binary files differnew file mode 100644 index 0000000..eb90a6b --- /dev/null +++ b/res/drawable-hdpi/ic_list_data_small.png diff --git a/res/drawable-hdpi/ic_list_gps_off.png b/res/drawable-hdpi/ic_list_gps_off.png Binary files differnew file mode 100644 index 0000000..b6bc3ba --- /dev/null +++ b/res/drawable-hdpi/ic_list_gps_off.png diff --git a/res/drawable-hdpi/ic_list_gps_on.png b/res/drawable-hdpi/ic_list_gps_on.png Binary files differnew file mode 100644 index 0000000..2c02e58 --- /dev/null +++ b/res/drawable-hdpi/ic_list_gps_on.png diff --git a/res/drawable-mdpi/ic_list_data_large.png b/res/drawable-mdpi/ic_list_data_large.png Binary files differnew file mode 100644 index 0000000..58f7c2f --- /dev/null +++ b/res/drawable-mdpi/ic_list_data_large.png diff --git a/res/drawable-mdpi/ic_list_data_off.png b/res/drawable-mdpi/ic_list_data_off.png Binary files differnew file mode 100644 index 0000000..69d4eae --- /dev/null +++ b/res/drawable-mdpi/ic_list_data_off.png diff --git a/res/drawable-mdpi/ic_list_data_small.png b/res/drawable-mdpi/ic_list_data_small.png Binary files differnew file mode 100644 index 0000000..3d40655 --- /dev/null +++ b/res/drawable-mdpi/ic_list_data_small.png diff --git a/res/drawable-mdpi/ic_list_gps_off.png b/res/drawable-mdpi/ic_list_gps_off.png Binary files differnew file mode 100644 index 0000000..ed73bce --- /dev/null +++ b/res/drawable-mdpi/ic_list_gps_off.png diff --git a/res/drawable-mdpi/ic_list_gps_on.png b/res/drawable-mdpi/ic_list_gps_on.png Binary files differnew file mode 100644 index 0000000..15ff6ee --- /dev/null +++ b/res/drawable-mdpi/ic_list_gps_on.png diff --git a/res/drawable/location.png b/res/drawable/location.png Binary files differdeleted file mode 100644 index c7eb1dc..0000000 --- a/res/drawable/location.png +++ /dev/null diff --git a/res/drawable/usage_empty.png b/res/drawable/usage_empty.png Binary files differdeleted file mode 100644 index 6a7e2db..0000000 --- a/res/drawable/usage_empty.png +++ /dev/null diff --git a/res/drawable/usage_high.png b/res/drawable/usage_high.png Binary files differdeleted file mode 100644 index 006e1ac..0000000 --- a/res/drawable/usage_high.png +++ /dev/null diff --git a/res/drawable/usage_low.png b/res/drawable/usage_low.png Binary files differdeleted file mode 100644 index 828ffb2..0000000 --- a/res/drawable/usage_low.png +++ /dev/null diff --git a/res/drawable/usage_medium.png b/res/drawable/usage_medium.png Binary files differdeleted file mode 100644 index dc37363..0000000 --- a/res/drawable/usage_medium.png +++ /dev/null diff --git a/res/layout/website_settings_row.xml b/res/layout/website_settings_row.xml index 911e1d6..4901ff1 100644 --- a/res/layout/website_settings_row.xml +++ b/res/layout/website_settings_row.xml @@ -22,8 +22,8 @@ android:padding="0dip"> <ImageView android:id="@+id/icon" - android:layout_width="32px" - android:layout_height="32px" + android:layout_width="32dip" + android:layout_height="32dip" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" android:layout_alignParentBottom="true" @@ -40,13 +40,13 @@ android:layout_marginRight="2dip"> <ImageView android:id="@+id/location_icon" - android:layout_width="32px" - android:layout_height="32px" + android:layout_width="32dip" + android:layout_height="32dip" android:padding="2dip" /> <ImageView android:id="@+id/usage_icon" - android:layout_width="32px" - android:layout_height="32px" + android:layout_width="32dip" + android:layout_height="32dip" android:padding="2dip" /> </LinearLayout> diff --git a/src/com/android/browser/WebsiteSettingsActivity.java b/src/com/android/browser/WebsiteSettingsActivity.java index 5260a25..3707b7e 100644 --- a/src/com/android/browser/WebsiteSettingsActivity.java +++ b/src/com/android/browser/WebsiteSettingsActivity.java @@ -158,9 +158,9 @@ public class WebsiteSettingsActivity extends ListActivity { private Bitmap mDefaultIcon; private Bitmap mUsageEmptyIcon; private Bitmap mUsageLowIcon; - private Bitmap mUsageMediumIcon; private Bitmap mUsageHighIcon; - private Bitmap mLocationIcon; + private Bitmap mLocationAllowedIcon; + private Bitmap mLocationDisallowedIcon; private Site mCurrentSite; public SiteAdapter(Context context, int rsc) { @@ -170,15 +170,15 @@ public class WebsiteSettingsActivity extends ListActivity { mDefaultIcon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher_shortcut_browser_bookmark); mUsageEmptyIcon = BitmapFactory.decodeResource(getResources(), - R.drawable.usage_empty); + R.drawable.ic_list_data_off); mUsageLowIcon = BitmapFactory.decodeResource(getResources(), - R.drawable.usage_low); - mUsageMediumIcon = BitmapFactory.decodeResource(getResources(), - R.drawable.usage_medium); + R.drawable.ic_list_data_small); mUsageHighIcon = BitmapFactory.decodeResource(getResources(), - R.drawable.usage_high); - mLocationIcon = BitmapFactory.decodeResource(getResources(), - R.drawable.location); + R.drawable.ic_list_data_large); + mLocationAllowedIcon = BitmapFactory.decodeResource(getResources(), + R.drawable.ic_list_gps_on); + mLocationDisallowedIcon = BitmapFactory.decodeResource(getResources(), + R.drawable.ic_list_gps_off); askForOrigins(); } @@ -358,16 +358,13 @@ public class WebsiteSettingsActivity extends ListActivity { // We set the correct icon: // 0 < empty < 0.1MB - // 0.1MB < low < 3MB - // 3MB < medium < 6MB - // 6MB < high + // 0.1MB < low < 5MB + // 5MB < high if (usageInMegabytes <= 0.1) { usageIcon.setImageBitmap(mUsageEmptyIcon); - } else if (usageInMegabytes > 0.1 && usageInMegabytes <= 3) { + } else if (usageInMegabytes > 0.1 && usageInMegabytes <= 5) { usageIcon.setImageBitmap(mUsageLowIcon); - } else if (usageInMegabytes > 3 && usageInMegabytes <= 6) { - usageIcon.setImageBitmap(mUsageMediumIcon); - } else if (usageInMegabytes > 6) { + } else if (usageInMegabytes > 5) { usageIcon.setImageBitmap(mUsageHighIcon); } } @@ -378,7 +375,7 @@ public class WebsiteSettingsActivity extends ListActivity { final TextView subtitle; ImageView icon; final ImageView usageIcon; - ImageView locationIcon; + final ImageView locationIcon; if (convertView == null) { view = mInflater.inflate(mResource, parent, false); @@ -412,20 +409,30 @@ public class WebsiteSettingsActivity extends ListActivity { // so that we can get it in onItemClick() view.setTag(site); + String origin = site.getOrigin(); if (site.hasFeature(Site.FEATURE_WEB_STORAGE)) { - String origin = site.getOrigin(); - WebStorage.getInstance().getUsageForOrigin(origin, new ValueCallback<Long>() { - public void onReceiveValue(Long value) { - if (value != null) { - setIconForUsage(usageIcon, value.longValue()); - } - } - }); + WebStorage.getInstance().getUsageForOrigin(origin, new ValueCallback<Long>() { + public void onReceiveValue(Long value) { + if (value != null) { + setIconForUsage(usageIcon, value.longValue()); + } + } + }); } if (site.hasFeature(Site.FEATURE_GEOLOCATION)) { - locationIcon.setVisibility(View.VISIBLE); - locationIcon.setImageBitmap(mLocationIcon); + locationIcon.setVisibility(View.VISIBLE); + GeolocationPermissions.getInstance().getAllowed(origin, new ValueCallback<Boolean>() { + public void onReceiveValue(Boolean allowed) { + if (allowed != null) { + if (allowed.booleanValue()) { + locationIcon.setImageBitmap(mLocationAllowedIcon); + } else { + locationIcon.setImageBitmap(mLocationDisallowedIcon); + } + } + } + }); } } else { setTitle(mCurrentSite.getPrettyTitle()); |