Merge branch 'cupcake'

This commit is contained in:
The Android Open Source Project 2009-01-20 14:05:40 -08:00
commit 6a4838d6c4
21 changed files with 129 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 0 B

View File

@ -43,7 +43,7 @@
android:layout_marginLeft="1dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/ic_btn_search"
android:src="@*android:drawable/ic_btn_search"
/>
</com.android.launcher.Search>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string-array name="extra_wallpapers">
</string-array>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string-array name="extra_wallpapers">
</string-array>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string-array name="extra_wallpapers">
</string-array>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string-array name="extra_wallpapers">
</string-array>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string-array name="extra_wallpapers">
</string-array>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string-array name="extra_wallpapers">
</string-array>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string-array name="extra_wallpapers">
</string-array>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string-array name="extra_wallpapers">
</string-array>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string-array name="extra_wallpapers">
</string-array>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string-array name="extra_wallpapers">
</string-array>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string-array name="extra_wallpapers">
</string-array>
</resources>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
* Copyright (C) 2009 Google Inc.
*
* 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.
-->
<resources>
<string-array name="extra_wallpapers">
</string-array>
</resources>

View File

@ -819,7 +819,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
.setIcon(android.R.drawable.ic_search_category_default)
.setAlphabeticShortcut(SearchManager.MENU_KEY);
menu.add(0, MENU_NOTIFICATIONS, 0, R.string.menu_notifications)
.setIcon(android.R.drawable.ic_menu_notifications)
.setIcon(com.android.internal.R.drawable.ic_menu_notifications)
.setAlphabeticShortcut('N');
final Intent settings = new Intent(android.provider.Settings.ACTION_SETTINGS);

View File

@ -32,9 +32,12 @@ import android.widget.ImageView;
import android.graphics.BitmapFactory;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.content.res.Resources;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
public class WallpaperChooser extends Activity implements AdapterView.OnItemSelectedListener,
OnClickListener {
@ -55,9 +58,6 @@ public class WallpaperChooser extends Activity implements AdapterView.OnItemSele
R.drawable.wallpaper_grey_small,
R.drawable.wallpaper_green_small,
R.drawable.wallpaper_pink_small,
R.drawable.wallpaper_dale_chihuly_small,
R.drawable.wallpaper_john_maeda_small,
R.drawable.wallpaper_marc_ecko_small,
};
private static final Integer[] IMAGE_IDS = {
@ -76,9 +76,6 @@ public class WallpaperChooser extends Activity implements AdapterView.OnItemSele
R.drawable.wallpaper_grey,
R.drawable.wallpaper_green,
R.drawable.wallpaper_pink,
R.drawable.wallpaper_dale_chihuly,
R.drawable.wallpaper_john_maeda,
R.drawable.wallpaper_marc_ecko,
};
private Gallery mGallery;
@ -88,11 +85,16 @@ public class WallpaperChooser extends Activity implements AdapterView.OnItemSele
private BitmapFactory.Options mOptions;
private Bitmap mBitmap;
private ArrayList<Integer> mThumbs;
private ArrayList<Integer> mImages;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
requestWindowFeature(Window.FEATURE_NO_TITLE);
findWallpapers();
setContentView(R.layout.wallpaper_chooser);
mOptions = new BitmapFactory.Options();
@ -103,13 +105,41 @@ public class WallpaperChooser extends Activity implements AdapterView.OnItemSele
mGallery.setAdapter(new ImageAdapter(this));
mGallery.setOnItemSelectedListener(this);
mGallery.setCallbackDuringFling(false);
Button b = (Button) findViewById(R.id.set);
b.setOnClickListener(this);
mImageView = (ImageView) findViewById(R.id.wallpaper);
}
private void findWallpapers() {
mThumbs = new ArrayList<Integer>(THUMB_IDS.length + 4);
Collections.addAll(mThumbs, THUMB_IDS);
mImages = new ArrayList<Integer>(IMAGE_IDS.length + 4);
Collections.addAll(mImages, IMAGE_IDS);
final Resources resources = getResources();
final String[] extras = resources.getStringArray(R.array.extra_wallpapers);
final String packageName = getApplication().getPackageName();
final ArrayList<Integer> images = mImages;
final ArrayList<Integer> thumbs = mThumbs;
for (String extra : extras) {
int res = resources.getIdentifier(extra, "drawable", packageName);
if (res != 0) {
final int thumbRes = resources.getIdentifier(extra + "_small",
"drawable", packageName);
if (thumbRes != 0) {
images.add(res);
thumbs.add(res);
}
}
}
}
@Override
protected void onResume() {
super.onResume();
@ -144,7 +174,7 @@ public class WallpaperChooser extends Activity implements AdapterView.OnItemSele
mIsWallpaperSet = true;
try {
InputStream stream = getResources().openRawResource(IMAGE_IDS[position]);
InputStream stream = getResources().openRawResource(mImages.get(position));
setWallpaper(stream);
setResult(RESULT_OK);
finish();
@ -164,7 +194,7 @@ public class WallpaperChooser extends Activity implements AdapterView.OnItemSele
}
public int getCount() {
return THUMB_IDS.length;
return mThumbs.size();
}
public Object getItem(int position) {
@ -184,7 +214,7 @@ public class WallpaperChooser extends Activity implements AdapterView.OnItemSele
image = (ImageView) convertView;
}
image.setImageResource(THUMB_IDS[position]);
image.setImageResource(mThumbs.get(position));
image.getDrawable().setDither(true);
return image;
}