Android Application Interface Theme Theme use method and page timing jump application _android

Source: Internet
Author: User
Theme theme is used to set the UI style of the interface, you can set the entire application or an activity of the interface style. The following theme are built into the Android SDK and can be categorized by whether the title bar and status bar status bars are visible:

Copy Code code as follows:

Android:theme= "@android: Style/theme.dialog" displays an activity as an energy-box mode
Android:theme= "@android: Style/theme.notitlebar" does not display the application title bar
Android:theme= "@android: Style/theme.notitlebar.fullscreen" does not display the application title bar and is full screen
Android:theme= "Theme.light" background is white
Android:theme= "Theme.Light.NoTitleBar" white background with no title bar
Android:theme= "Theme.Light.NoTitleBar.Fullscreen" white background, no title bar, full screen
Android:theme= "Theme.black" background black
Android:theme= "Theme.Black.NoTitleBar" black background with no title bar
Android:theme= "Theme.Black.NoTitleBar.Fullscreen" black background, no title bar, full screen
Android:theme= "Theme.wallpaper" with system desktop for application background
Android:theme= "Theme.Wallpaper.NoTitleBar" with the system desktop as the application background with no title bar
Android:theme= "Theme.Wallpaper.NoTitleBar.Fullscreen" with system desktop for application background, no title bar, full screen
Android:theme= "Translucent" translucent
Android:theme= "Theme.Translucent.NoTitleBar" translucent, no title bar
Android:theme= "Theme.Translucent.NoTitleBar.Fullscreen" translucent, no title bar, full screen
Android:theme= "Theme.panel"
Android:theme= "Theme.Light.Panel"

Copy Code code as follows:

Android:theme= "@android: Style/theme.dialog" displays an activity as an energy-box mode
Android:theme= "@android: Style/theme.notitlebar" does not display the application title bar
Android:theme= "@android: Style/theme.notitlebar.fullscreen" does not display the application title bar and is full screen
Android:theme= "Theme.light" background is white
Android:theme= "Theme.Light.NoTitleBar" white background with no title bar
Android:theme= "Theme.Light.NoTitleBar.Fullscreen" white background, no title bar, full screen
Android:theme= "Theme.black" background black
Android:theme= "Theme.Black.NoTitleBar" black background with no title bar
Android:theme= "Theme.Black.NoTitleBar.Fullscreen" black background, no title bar, full screen
Android:theme= "Theme.wallpaper" with system desktop for application background
Android:theme= "Theme.Wallpaper.NoTitleBar" with the system desktop as the application background with no title bar
Android:theme= "Theme.Wallpaper.NoTitleBar.Fullscreen" with system desktop for application background, no title bar, full screen
Android:theme= "Translucent" translucent
Android:theme= "Theme.Translucent.NoTitleBar" translucent, no title bar
Android:theme= "Theme.Translucent.NoTitleBar.Fullscreen" translucent, no title bar, full screen
Android:theme= "Theme.panel"
Android:theme= "Theme.Light.Panel"

These topics can be applied to the entire application application scope or to an activity scope.
Apply Application Range
The theme property is set in the application node in Androidmanifest.xml, and the theme theme applied to the entire application.
Copy Code code as follows:

<application
android:icon= "@drawable/icon"
android:icon= "@string/app_name"
Android:icon= "@android: Style/theme.black.notitlebar" >

Activity Range
The theme is applied to the current activity only by using Java code or by setting the subject of the active activity in Androidmanifest.xml.
To set the method in Androidmainifest.xml:
Copy Code code as follows:

<activity
Android:name= ". About "
Android:label= "@string/app_name"
Android:theme= "@android: Style/theme.black.notitlebar" >

Set using Java code, set in the OnCreate of the current active activity:
Copy Code code as follows:

@Override
public void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
Settheme (Android. R.style.theme_translucent_notitlebar);
Setcontentview (R.layout.main);
}

-------------Jump---------------------
Copy Code code as follows:

public void Start () {
New Thread () {
public void Run () {
try {
Thread.Sleep (3000);
catch (Interruptedexception e) {
E.printstacktrace ();
}
Intent Intent = new Intent ();
Intent.setclass (Welcomeactivity.this, Mainactivity.class);
StartActivity (Intent);
Finish ();
}
}.start ();
}

---------to add the effect to the button-----------
Copy Code code as follows:

ImageButton1 = (ImageButton) Findviewbyid (R.id.imagebutton3);
Imagebutton1.setontouchlistener (New Ontouchlistener () {
Public boolean ontouch (View V, motionevent event) { if (event.getaction () = = Motionevent.action_down) {
//change to background picture when pressed
V.setbackgroundresource (r.drawable.menu_ Btn_f);
} else if (event.getaction () = motionevent.action_up) {
/////////////////////// NU_BTN);
}
return false;
}
});
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.