"While doing project learning Android" Mobile security defender 09-Mobile anti-Theft Interface Setup Wizard 1

Source: Internet
Author: User

This is the main mobile phone anti-Theft Interface Setup Wizard function interface design.

Demand:

When the user enters the mobile phone anti-theft interface, determine whether the user has already set up the wizard:

    • If the user has already set up the phone anti-theft, no longer prompt the user to enter the phone wizard
    • If not set, the user is prompted to enter the Setup wizard interface.
Specific implementation:
    • 1. When the user enters "mobile phone anti-theft" password is correct, to determine whether the user has set up the wizard
/** * Determine if User has set Wizard @return */private Boolean issetup () {    return Sp.getboolean ("Isalreadysetup", false);}
    • 2. Create the activity of the Setup Wizard and add it to the Androidmanifest.xml manifest file

Setupwizard1activity.java

public class Setupwizard1activity extends Activity {    @Override    protected void OnCreate (Bundle Savedinstancestate) {        super.oncreate (savedinstancestate);        Setcontentview (R.LAYOUT.SETUP_WIZARD1);    }}
    • 3. Add an XML layout file/mobilesafe/res/layout/setup_wizard1.xml
      • 3.1. Because the title Text style of each wizard interface is uniform, you can extract the title text style:

        • /mobilesafe/res/values/style.xml
<style name= "Text_title_style" >    <item name= "Android:layout_width" >fill_parent</item>    <item name= "Android:layout_height" >wrap_content</item>    <item name= "Android:textsize" >28sp </item>    <item name= "Android:textcolor" > #ff00ff66 </item></style>
      • 3.2. The split line under the heading is often used later, and the split line is abstracted here.
<style name= "Devide_line_style" >    <item name= "Android:layout_width" >fill_parent</item>    <item name= "Android:layout_height" >wrap_content</item>    <item name= "Android:layout_margintop" >8dip</item>    <item name= "Android:layout_marginbottom" >8dip</item>    <item name= " Android:background "> @drawable/devide_line</item></style>
      • 3.3. Body Content Style
<style name= "Text_content_style" >    <item name= "Android:layout_width" >fill_parent</item>    <item name= "android:layout_height" >wrap_content</item>    <item name= "Android:textsize" >20sp</item>    <item name= "Android:textcolor" > #ff00ff66 </item></style>
      • 3.4. The little star before the text
<style name= "Image_star_style" >    <item name= "Android:layout_width" >wrap_content</item>    <item name= "Android:layout_height" >wrap_content</item>    <item name= "Android:src" > @android: drawable/btn_star_big_on</item>    <item name= "Android:layout_marginleft" >8dip</item></ Style>

The picture resources here use Android's own resources, using the @android of the image resources under the benefits: 1. Reduce the volume of the program by 2. Increase the speed with which the program gets pictures

      • 3.5. Progress Display icon
<linearlayout    android:layout_width= "fill_parent"    android:layout_height= "Wrap_content"    android: layout_margintop= "5dip"    android:gravity= "center_horizontal"    android:orientation= "Horizontal" >    <imageview style= "@style/image_status_on_style"/>    <imageview style= "@style/image_status_off_style"/ >    <imageview style= "@style/image_status_off_style"/><imageview style= "@style/image_status_off_ Style "/></linearlayout>
      • 3.5. Icons and "Next"
<relativelayoutandroid:layout_width= "Fill_parent" android:layout_height= "fill_parent" >    < LinearLayout        android:layout_width= "fill_parent"        android:layout_height= "Wrap_content"        android: layout_margintop= "10dip" | Center_horizontal "|        android:orientation= "vertical" >        <imageview            android:layout_width= "Wrap_content"            android: layout_height= "Wrap_content"            android:src= "@drawable/setup1"/>    </LinearLayout>    < Button        android:layout_width= "wrap_content"        android:layout_height= "wrap_content"        android:layout_ Alignparentbottom= "true"        android:layout_alignparentright= "true"        android:drawableright= "@drawable/ Next "        android:text=" Next "/></relativelayout>
    • 4./mobilesafe/res/layout/setup_wizard1.xml
<?xml version= "1.0" encoding= "Utf-8"? ><linearlayout xmlns:android= "http://schemas.android.com/apk/res/ Android "Android:layout_width=" Match_parent "android:layout_height=" match_parent "android:background=" @color/back Ground "android:orientation=" vertical "> <textview style=" @style/text_title_style "android:text= "1. Welcome to use mobile phone anti-theft"/> <imageview style= "@style/devide_line_style"/> <textview style= "@style/text_cont Ent_style "android:text=" Your mobile phone guard can: "/> <linearlayout android:layout_width=" Fill_parent "an        droid:layout_height= "Wrap_content" android:layout_margintop= "5dip" android:orientation= "Horizontal" >            <imageview style= "@style/image_star_style"/> <textview style= "@style/text_content_style"        android:paddingtop= "5dip" android:text= "SIM card change Alarm"/> </LinearLayout> <linearlayout Android:layout_width= "Fill_pArent "android:layout_height=" wrap_content "android:layout_margintop=" 5dip "android:orientation=" Hori Zontal "> <imageview style=" @style/image_star_style "/> <textview style=" @style/text_ Content_style "android:paddingtop=" 5dip "android:text=" GPS tracking "/> </LinearLayout> < LinearLayout android:layout_width= "fill_parent" android:layout_height= "Wrap_content" android:layout_m        argintop= "5dip" android:orientation= "horizontal" > <imageview style= "@style/image_star_style"/> <textview style= "@style/text_content_style" android:paddingtop= "5dip" Android:tex t= "Remote destroy data"/> </LinearLayout> <linearlayout android:layout_width= "Fill_parent" Android:lay out_height= "Wrap_content" android:layout_margintop= "5dip" android:orientation= "Horizontal" > <I Mageview style= "@style/IMage_star_style "/> <textview style=" @style/text_content_style "android:paddingtop=" 5di P "android:text=" Remote lock screen "/> </LinearLayout> <linearlayout android:layout_width=" Fill_par Ent "android:layout_height=" wrap_content "android:layout_margintop=" 5dip "android:gravity=" Center_hor        Izontal "android:orientation=" horizontal "> <imageview style=" @style/image_status_on_style "/> <imageview style= "@style/image_status_off_style"/> <imageview style= "@style/image_status_off_style"/&        Gt <imageview style= "@style/image_status_off_style"/> </LinearLayout> <relativelayout Android:la Yout_width= "Fill_parent" android:layout_height= "fill_parent" > <linearlayout android:layout            _width= "Fill_parent" android:layout_height= "wrap_content" android:layout_margintop= "10dip" Android:graVity= "Center_vertical|center_horizontal" android:orientation= "vertical" > <imageview Android:layout_width= "Wrap_content" android:layout_height= "Wrap_content" android:src= "            @drawable/setup1 "/> </LinearLayout> <button android:layout_width=" Wrap_content " android:layout_height= "Wrap_content" android:layout_alignparentbottom= "true" android:layout_a Lignparentright= "true" android:drawableright= "@drawable/next" android:text= "Next"/> </relat Ivelayout></linearlayout>
    • 5. Interface Jump
if (Issetup ()) {log.i (TAG, "load mobile phone anti-theft main interface");} ELSE{LOG.I (TAG, "Activate Setup Wizard Interface"); Finish (); Intent Intent = new Intent (Getapplicationcontext (), Setupwizard1activity.class) ; StartActivity (intent);}
    • 6. Display effect

"While doing project learning Android" Mobile security defender 09-Mobile anti-Theft Interface Setup Wizard 1

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.