packages/wallpapers/Basic
修订版 | 1a430b831f813351d6382a16943ef2910a2bb433 (tree) |
---|---|
时间 | 2009-08-29 09:05:02 |
作者 | Romain Guy <romainguy@andr...> |
Commiter | Romain Guy |
Add standalone versions of the wallpapers.
Change-Id: I1b0e744d7e37eaede7aec7b205fd106e2aded6ef
@@ -25,6 +25,30 @@ | ||
25 | 25 | android:label="@string/wallpapers" |
26 | 26 | android:icon="@drawable/ic_launcher_wallpaper"> |
27 | 27 | |
28 | + <activity | |
29 | + android:label="@string/wallpaper_grass" | |
30 | + android:name="com.android.wallpaper.grass.Grass" | |
31 | + android:theme="@android:style/Theme.NoTitleBar"> | |
32 | + | |
33 | + <intent-filter> | |
34 | + <action android:name="android.intent.action.MAIN" /> | |
35 | + <category android:name="android.intent.category.LAUNCHER" /> | |
36 | + </intent-filter> | |
37 | + | |
38 | + </activity> | |
39 | + | |
40 | + <activity | |
41 | + android:label="@string/wallpaper_galaxy" | |
42 | + android:name="com.android.wallpaper.galaxy.Galaxy" | |
43 | + android:theme="@android:style/Theme.NoTitleBar"> | |
44 | + | |
45 | + <intent-filter> | |
46 | + <action android:name="android.intent.action.MAIN" /> | |
47 | + <category android:name="android.intent.category.LAUNCHER" /> | |
48 | + </intent-filter> | |
49 | + | |
50 | + </activity> | |
51 | + | |
28 | 52 | <service |
29 | 53 | android:label="@string/wallpaper_grass" |
30 | 54 | android:name="com.android.wallpaper.grass.GrassWallpaper" |
@@ -0,0 +1,47 @@ | ||
1 | +/* | |
2 | + * Copyright (C) 2009 The Android Open Source Project | |
3 | + * | |
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | + * you may not use this file except in compliance with the License. | |
6 | + * You may obtain a copy of the License at | |
7 | + * | |
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | + * | |
10 | + * Unless required by applicable law or agreed to in writing, software | |
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | + * See the License for the specific language governing permissions and | |
14 | + * limitations under the License. | |
15 | + */ | |
16 | + | |
17 | + | |
18 | +package com.android.wallpaper.galaxy; | |
19 | + | |
20 | +import android.app.Activity; | |
21 | +import android.os.Bundle; | |
22 | + | |
23 | +public class Galaxy extends Activity { | |
24 | + private GalaxyView mView; | |
25 | + | |
26 | + @Override | |
27 | + public void onCreate(Bundle icicle) { | |
28 | + super.onCreate(icicle); | |
29 | + | |
30 | + mView = new GalaxyView(this); | |
31 | + setContentView(mView); | |
32 | + } | |
33 | + | |
34 | + @Override | |
35 | + protected void onResume() { | |
36 | + super.onResume(); | |
37 | + mView.onResume(); | |
38 | + } | |
39 | + | |
40 | + @Override | |
41 | + protected void onPause() { | |
42 | + super.onPause(); | |
43 | + mView.onPause(); | |
44 | + | |
45 | + Runtime.getRuntime().exit(0); | |
46 | + } | |
47 | +} |
@@ -0,0 +1,43 @@ | ||
1 | +/* | |
2 | + * Copyright (C) 2009 The Android Open Source Project | |
3 | + * | |
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | + * you may not use this file except in compliance with the License. | |
6 | + * You may obtain a copy of the License at | |
7 | + * | |
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | + * | |
10 | + * Unless required by applicable law or agreed to in writing, software | |
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | + * See the License for the specific language governing permissions and | |
14 | + * limitations under the License. | |
15 | + */ | |
16 | + | |
17 | + | |
18 | +package com.android.wallpaper.galaxy; | |
19 | + | |
20 | +import android.renderscript.RSSurfaceView; | |
21 | +import android.renderscript.RenderScript; | |
22 | +import android.content.Context; | |
23 | +import android.view.SurfaceHolder; | |
24 | + | |
25 | +class GalaxyView extends RSSurfaceView { | |
26 | + | |
27 | + public GalaxyView(Context context) { | |
28 | + super(context); | |
29 | + setFocusable(true); | |
30 | + setFocusableInTouchMode(true); | |
31 | + } | |
32 | + | |
33 | + public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { | |
34 | + super.surfaceChanged(holder, format, w, h); | |
35 | + | |
36 | + RenderScript RS = createRenderScript(false); | |
37 | + GalaxyRS render = new GalaxyRS(w, h); | |
38 | + render.init(RS, getResources()); | |
39 | + render.setOffset(0.5f, 0.0f, 0, 0); | |
40 | + render.start(); | |
41 | + } | |
42 | +} | |
43 | + |
@@ -0,0 +1,47 @@ | ||
1 | +/* | |
2 | + * Copyright (C) 2009 The Android Open Source Project | |
3 | + * | |
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | + * you may not use this file except in compliance with the License. | |
6 | + * You may obtain a copy of the License at | |
7 | + * | |
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | + * | |
10 | + * Unless required by applicable law or agreed to in writing, software | |
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | + * See the License for the specific language governing permissions and | |
14 | + * limitations under the License. | |
15 | + */ | |
16 | + | |
17 | + | |
18 | +package com.android.wallpaper.grass; | |
19 | + | |
20 | +import android.app.Activity; | |
21 | +import android.os.Bundle; | |
22 | + | |
23 | +public class Grass extends Activity { | |
24 | + private GrassView mView; | |
25 | + | |
26 | + @Override | |
27 | + public void onCreate(Bundle icicle) { | |
28 | + super.onCreate(icicle); | |
29 | + | |
30 | + mView = new GrassView(this); | |
31 | + setContentView(mView); | |
32 | + } | |
33 | + | |
34 | + @Override | |
35 | + protected void onResume() { | |
36 | + super.onResume(); | |
37 | + mView.onResume(); | |
38 | + } | |
39 | + | |
40 | + @Override | |
41 | + protected void onPause() { | |
42 | + super.onPause(); | |
43 | + mView.onPause(); | |
44 | + | |
45 | + Runtime.getRuntime().exit(0); | |
46 | + } | |
47 | +} | |
\ No newline at end of file |
@@ -0,0 +1,42 @@ | ||
1 | +/* | |
2 | + * Copyright (C) 2009 The Android Open Source Project | |
3 | + * | |
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | + * you may not use this file except in compliance with the License. | |
6 | + * You may obtain a copy of the License at | |
7 | + * | |
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | + * | |
10 | + * Unless required by applicable law or agreed to in writing, software | |
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | + * See the License for the specific language governing permissions and | |
14 | + * limitations under the License. | |
15 | + */ | |
16 | + | |
17 | + | |
18 | +package com.android.wallpaper.grass; | |
19 | + | |
20 | +import android.renderscript.RSSurfaceView; | |
21 | +import android.renderscript.RenderScript; | |
22 | +import android.content.Context; | |
23 | +import android.view.SurfaceHolder; | |
24 | + | |
25 | +class GrassView extends RSSurfaceView { | |
26 | + | |
27 | + public GrassView(Context context) { | |
28 | + super(context); | |
29 | + setFocusable(true); | |
30 | + setFocusableInTouchMode(true); | |
31 | + } | |
32 | + | |
33 | + public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { | |
34 | + super.surfaceChanged(holder, format, w, h); | |
35 | + | |
36 | + RenderScript RS = createRenderScript(false); | |
37 | + GrassRS render = new GrassRS(w, h); | |
38 | + render.init(RS, getResources()); | |
39 | + render.setOffset(0.5f, 0.0f, 0, 0); | |
40 | + render.start(); | |
41 | + } | |
42 | +} | |
\ No newline at end of file |