Roll android_tools support library to 25.1.0
[android_tools.git] / sdk / sources / android-23 / android / app / TranslucentFancyActivity.java
blob35abaaa179d1846ed1525c6eb197e2cae9bd9c23
1 /*
2 * Copyright (C) 2007 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package android.app;
19 import com.android.frameworks.coretests.R;
21 import android.app.Activity;
22 import android.os.Bundle;
23 import android.view.WindowManager;
26 /**
27 * <h3>Fancy Translucent Activity</h3>
29 * <p>This demonstrates the how to write an activity that is translucent,
30 * allowing windows underneath to show through, with a fancy
31 * compositing effect.</p>
33 * <h4>Demo</h4>
34 * App/Activity/Translucent Fancy
36 * <h4>Source files</h4>
37 * <table class="LinkTable">
38 * <tr>
39 * <td >src/com/android/samples/app/TranslucentFancyActivity.java</td>
40 * <td >The Translucent Fancy Screen implementation</td>
41 * </tr>
42 * <tr>
43 * <td >/res/any/layout/translucent_background.xml</td>
44 * <td >Defines contents of the screen</td>
45 * </tr>
46 * </table>
48 public class TranslucentFancyActivity extends Activity
50 /**
51 * Initialization of the Activity after it is first created. Must at least
52 * call {@link android.app.Activity#setContentView setContentView()} to
53 * describe what is to be displayed in the screen.
55 @Override
56 protected void onCreate(Bundle icicle)
58 // Be sure to call the super class.
59 super.onCreate(icicle);
61 // Have the system blur any windows behind this one.
62 getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
63 WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
65 // See assets/res/any/layout/translucent_background.xml for this
66 // view layout definition, which is being set here as
67 // the content of our screen.
68 setContentView(R.layout.translucent_background);