[Apidemos for Android samples video series] app-activity-translucentblur and wallpaper

Source: Internet
Author: User

1. Demo description and demonstration

  • Translucentbulr: In this example, blur is different from translucent, that is, other activities behind the current activity are displayed in Fuzzy mode. This is set through the flag of the window object.
  • Wallpaper: wallpaper describes how to use a style to set the system wallpaper as the background of the current activity.

Demo

2. Video description

Http://www.eyeandroid.com/thread-11139-1-1.html

3. Demo Analysis

This example is different from translucent in Blur, that is, other activities displayed behind the current activit are displayed in Fuzzy mode.

This is set through the flag of the window object.

 
  1. Getwindow (). setflags (windowmanager. layoutparams. flag_blur_behind,
  2. Windowmanager. layoutparams. flag_blur_behind );

 

Other theme and translucent settings are the same.

 

Certificate -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Wallpaper describes how to use a style to set the system wallpaper as the background of the current activity.

This is the definition of wallpaperactivity in androidmanifest. xml:

<Activity Android: Name = ". App. wallpaperactivity"
Android: Label = "@ string/activity_wallpaper"
Android: theme = "@ style/theme. Wallpaper">
<Intent-filter>
<Action Android: Name = "android. Intent. Action. Main"/>
<Category Android: Name = "android. Intent. Category. sample_code"/>
</Intent-filter>
</Activity>

@ Style/theme. wallpaper is defined as follows: Inherit the Android: style/theme. wallpaper system and set the foreground color to white (the text color here)

<! -A theme that has a wallpaper background. Here we explicitly specify
That this theme is to inherit from the system's wallpaper theme,
Which sets up various attributes correctly.->
<Style name = "theme. Wallpaper" parent = "Android: style/theme. Wallpaper">
<Item name = "Android: colorforeground"> # fff </item>
</Style>

4. We learned this demo.

Android Application Development-Android: Theme

Http://www.eyeandroid.com/thread-8106-1-1.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.