summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Roard <nicolas@android.com>2009-09-30 16:54:34 +0100
committerNicolas Roard <nicolas@android.com>2009-09-30 16:54:34 +0100
commit9cdaba5e3f22fe9bdfc3b89c45e71d7497f5e9da (patch)
tree336495eced715afc2eafb44cc1e621a8205cbaf8
parent9957024e9a4c904c83d76df03c4ebf9bdaa5f4c6 (diff)
downloadpackages_apps_Browser-9cdaba5e3f22fe9bdfc3b89c45e71d7497f5e9da.zip
packages_apps_Browser-9cdaba5e3f22fe9bdfc3b89c45e71d7497f5e9da.tar.gz
packages_apps_Browser-9cdaba5e3f22fe9bdfc3b89c45e71d7497f5e9da.tar.bz2
New assets for settings
-rw-r--r--res/drawable-hdpi/ic_list_data_large.pngbin0 -> 606 bytes
-rw-r--r--res/drawable-hdpi/ic_list_data_off.pngbin0 -> 540 bytes
-rw-r--r--res/drawable-hdpi/ic_list_data_small.pngbin0 -> 581 bytes
-rw-r--r--res/drawable-hdpi/ic_list_gps_off.pngbin0 -> 957 bytes
-rw-r--r--res/drawable-hdpi/ic_list_gps_on.pngbin0 -> 1820 bytes
-rw-r--r--res/drawable-mdpi/ic_list_data_large.pngbin0 -> 428 bytes
-rw-r--r--res/drawable-mdpi/ic_list_data_off.pngbin0 -> 352 bytes
-rw-r--r--res/drawable-mdpi/ic_list_data_small.pngbin0 -> 410 bytes
-rw-r--r--res/drawable-mdpi/ic_list_gps_off.pngbin0 -> 685 bytes
-rw-r--r--res/drawable-mdpi/ic_list_gps_on.pngbin0 -> 1077 bytes
-rw-r--r--res/drawable/location.pngbin2953 -> 0 bytes
-rw-r--r--res/drawable/usage_empty.pngbin2909 -> 0 bytes
-rw-r--r--res/drawable/usage_high.pngbin2201 -> 0 bytes
-rw-r--r--res/drawable/usage_low.pngbin3023 -> 0 bytes
-rw-r--r--res/drawable/usage_medium.pngbin2780 -> 0 bytes
-rw-r--r--res/layout/website_settings_row.xml12
-rw-r--r--src/com/android/browser/WebsiteSettingsActivity.java61
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
new file mode 100644
index 0000000..aaa035d
--- /dev/null
+++ b/res/drawable-hdpi/ic_list_data_large.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_list_data_off.png b/res/drawable-hdpi/ic_list_data_off.png
new file mode 100644
index 0000000..f7eb6af
--- /dev/null
+++ b/res/drawable-hdpi/ic_list_data_off.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_list_data_small.png b/res/drawable-hdpi/ic_list_data_small.png
new file mode 100644
index 0000000..eb90a6b
--- /dev/null
+++ b/res/drawable-hdpi/ic_list_data_small.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_list_gps_off.png b/res/drawable-hdpi/ic_list_gps_off.png
new file mode 100644
index 0000000..b6bc3ba
--- /dev/null
+++ b/res/drawable-hdpi/ic_list_gps_off.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_list_gps_on.png b/res/drawable-hdpi/ic_list_gps_on.png
new file mode 100644
index 0000000..2c02e58
--- /dev/null
+++ b/res/drawable-hdpi/ic_list_gps_on.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_list_data_large.png b/res/drawable-mdpi/ic_list_data_large.png
new file mode 100644
index 0000000..58f7c2f
--- /dev/null
+++ b/res/drawable-mdpi/ic_list_data_large.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_list_data_off.png b/res/drawable-mdpi/ic_list_data_off.png
new file mode 100644
index 0000000..69d4eae
--- /dev/null
+++ b/res/drawable-mdpi/ic_list_data_off.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_list_data_small.png b/res/drawable-mdpi/ic_list_data_small.png
new file mode 100644
index 0000000..3d40655
--- /dev/null
+++ b/res/drawable-mdpi/ic_list_data_small.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_list_gps_off.png b/res/drawable-mdpi/ic_list_gps_off.png
new file mode 100644
index 0000000..ed73bce
--- /dev/null
+++ b/res/drawable-mdpi/ic_list_gps_off.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_list_gps_on.png b/res/drawable-mdpi/ic_list_gps_on.png
new file mode 100644
index 0000000..15ff6ee
--- /dev/null
+++ b/res/drawable-mdpi/ic_list_gps_on.png
Binary files differ
diff --git a/res/drawable/location.png b/res/drawable/location.png
deleted file mode 100644
index c7eb1dc..0000000
--- a/res/drawable/location.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable/usage_empty.png b/res/drawable/usage_empty.png
deleted file mode 100644
index 6a7e2db..0000000
--- a/res/drawable/usage_empty.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable/usage_high.png b/res/drawable/usage_high.png
deleted file mode 100644
index 006e1ac..0000000
--- a/res/drawable/usage_high.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable/usage_low.png b/res/drawable/usage_low.png
deleted file mode 100644
index 828ffb2..0000000
--- a/res/drawable/usage_low.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable/usage_medium.png b/res/drawable/usage_medium.png
deleted file mode 100644
index dc37363..0000000
--- a/res/drawable/usage_medium.png
+++ /dev/null
Binary files differ
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());