ConfigureGuide.java :  » Email » amail » com » dujin » amail » Android Open Source

Android Open Source » Email » amail 
amail » com » dujin » amail » ConfigureGuide.java
package com.dujin.amail;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.InputType;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
//import android.widget.Toast;

public class ConfigureGuide extends Activity{
  
  int image_id;
  ImageView imageView_Icon;
  CheckBox checkBox_ifShowPsd;
  CheckBox checkBox_SetupModel;
  TextView textView_PsdTips;
  TextView textView_SetupTips;
  EditText editText_PassWord;
  Button button_Login;
  
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.configure_guide);
    
    imageView_Icon = (ImageView) findViewById(R.id.Image_MailIcon);
    Bundle bundle = getIntent().getExtras();
    
    if(bundle!=null){
      image_id = (Integer) bundle.get("ItemIcon");
    }
    imageView_Icon.setBackgroundResource(image_id);
    
    checkBox_ifShowPsd = (CheckBox) findViewById(R.id.CheckBox_ifShowPsd);
    checkBox_SetupModel = (CheckBox) findViewById(R.id.CheckBox_SetupModel);
    textView_PsdTips = (TextView) findViewById(R.id.TextView_PsdTips);
    textView_SetupTips = (TextView) findViewById(R.id.TextView_SetupTips);
    editText_PassWord = (EditText) findViewById(R.id.EditText_PassWord);
    button_Login = (Button) findViewById(R.id.Button_Login);
    
    editText_PassWord.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);//
    
    checkBox_ifShowPsd.setOnClickListener(new View.OnClickListener() {      
      @Override
      public void onClick(View v) {
        // TODO Auto-generated method stub
        if(checkBox_ifShowPsd.isChecked()) {
          textView_PsdTips.setText("You can uncheck the checkbox to hide your password.");
          editText_PassWord.setInputType(InputType.TYPE_CLASS_TEXT |InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);//
        }
        else {
          textView_PsdTips.setText("You can check the checkbox to show your password.");
          editText_PassWord.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);//
        }
      }
    });
    
    checkBox_SetupModel.setOnClickListener(new View.OnClickListener() {
      
      @Override
      public void onClick(View v) {
        // TODO Auto-generated method stub
        if(checkBox_SetupModel.isChecked())
          textView_SetupTips.setText("You can uncheck the checkbox to auto setup.");
        else
          textView_SetupTips.setText("You can check the checkbox to manual setup.");
      }
    });  
    
    button_Login.setOnClickListener(new View.OnClickListener() {
      
      @Override
      public void onClick(View v) {
        // TODO Auto-generated method stub
        Intent intent = new Intent(ConfigureGuide.this, ManualSetup.class);
        startActivity(intent);
        //Toast.makeText(getApplicationContext(), "111111",Toast.LENGTH_SHORT).show();//,

      }
    });
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.