自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Android App 登錄界面

移動開發(fā)
簡單的Android App 登錄界面

源碼簡介:簡單的Android App 登錄界面

源碼效果:

源碼片段:

  1. public class LoginActivity extends ActionBarActivity { 
  2.   
  3.     private Context context; 
  4.   
  5.     @Override 
  6.     protected void onCreate(Bundle savedInstanceState) { 
  7.         super.onCreate(savedInstanceState); 
  8.         setContentView(R.layout.activity_login); 
  9.   
  10.         context = getApplicationContext(); 
  11.   
  12.         createLogo(); 
  13.         createToast(R.id.tvNext, "Next"); 
  14.         createToast(R.id.tvSignup, "Sign Up"); 
  15.         createToast(R.id.tvPolicy, "Privacy Policy"); 
  16.         createToast(R.id.tvForgot, "Forgot Password, huh?"); 
  17.         createLoginEvent(); 
  18.     } 
  19.   
  20.     private void createLogo(){ 
  21.         Typeface vibeFont = Typeface.createFromAsset(getAssets(), "fonts/GreatVibes-Regular.otf"); 
  22.         TextView tvLogo = (TextView) findViewById(R.id.tvLogo); 
  23.         tvLogo.setTypeface(vibeFont); 
  24.     } 
  25.   
  26.     private void createToast(int viewId, final String text){ 
  27.         TextView view = (TextView) findViewById(viewId); 
  28.         view.setOnClickListener(new View.OnClickListener() { 
  29.             @Override 
  30.             public void onClick(View v) { 
  31.                 Toast.makeText(context, text, Toast.LENGTH_SHORT).show(); 
  32.             } 
  33.         }); 
  34.     } 
  35.   
  36.     private void createLoginEvent(){ 
  37.         EditText etPassword = (EditText) findViewById(R.id.etPassword); 
  38.         etPassword.setOnKeyListener(new View.OnKeyListener() { 
  39.             @Override 
  40.             public boolean onKey(View v, int keyCode, KeyEvent event) { 
  41.                 if (keyCode == KeyEvent.KEYCODE_ENTER) { 
  42.                     Toast.makeText(context, "Logging in..", Toast.LENGTH_SHORT).show(); 
  43.                 } 
  44.                 return false
  45.             } 
  46.         }); 
  47.     } 
  48.   
  49.   
  50.     @Override 
  51.     public boolean onCreateOptionsMenu(Menu menu) { 
  52.         // Inflate the menu; this adds items to the action bar if it is present. 
  53.         getMenuInflater().inflate(R.menu.menu_login, menu); 
  54.         return true
  55.     } 
  56.   
  57.     @Override 
  58.     public boolean onOptionsItemSelected(MenuItem item) { 
  59.         // Handle action bar item clicks here. The action bar will 
  60.         // automatically handle clicks on the Home/Up button, so long 
  61.         // as you specify a parent activity in AndroidManifest.xml. 
  62.         int id = item.getItemId(); 
  63.   
  64.         //noinspection SimplifiableIfStatement 
  65.         if (id == R.id.action_settings) { 
  66.             return true
  67.         } 
  68.   
  69.         return super.onOptionsItemSelected(item); 
  70.     } 

下載地址:http://down.51cto.com/data/2115241

責任編輯:倪明 來源: devstore
相關推薦

2019-10-11 19:04:23

APP界面布局導航

2023-05-19 19:35:11

ChatGPT數(shù)據(jù)泄露

2015-10-13 09:15:18

App登錄模塊設計

2011-09-01 10:21:18

ubuntugdm

2015-08-12 16:12:15

Windows 10登錄

2019-07-08 14:33:25

資訊類APPAPP界面設計

2017-08-03 14:50:53

Windows 10Windows登錄界面

2011-07-14 15:28:28

Ubuntu 11.1

2015-08-28 09:40:39

自動登錄webapp

2013-05-28 14:39:25

Android開發(fā)Android App

2009-02-17 23:51:57

Linux程序登錄界面

2009-06-23 08:39:01

微軟Windows 7操作系統(tǒng)

2011-08-19 15:42:39

win7登陸界面ogo信息

2018-11-29 11:12:33

UbuntuGDM界面背景

2013-03-18 09:58:58

Windows 8

2016-10-14 08:45:19

Windows 10隱藏密碼

2011-06-21 14:12:14

Qt Linux 登錄界面

2014-08-21 10:14:09

APP界面設計移動客戶端

2011-12-20 10:42:22

Android應用界面設計

2010-08-03 10:40:43

點贊
收藏

51CTO技術棧公眾號