欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

Android登陸界面用戶名檢測功能-創(chuàng)新互聯(lián)

今天分享一下登陸界面用戶登錄名的檢測,大家都知道如果在服務(wù)器端進行所有用戶名的檢測是比較浪費資源的。用戶每點擊一次登陸就要發(fā)到服務(wù)端去檢測,對于服務(wù)端來說負荷是比較大的。所以呢在客服端對用戶的非法信息進行簡單的過濾是非常有必要的。

專業(yè)成都網(wǎng)站建設(shè)公司,做排名好的好網(wǎng)站,排在同行前面,為您帶來客戶和效益!成都創(chuàng)新互聯(lián)公司為您提供成都網(wǎng)站建設(shè),五站合一網(wǎng)站設(shè)計制作,服務(wù)好的網(wǎng)站設(shè)計公司,網(wǎng)站設(shè)計、成都做網(wǎng)站負責(zé)任的成都網(wǎng)站制作公司!

源碼下載:Android用戶名檢測


首先看一下效果:


 


當(dāng)輸入的用戶名大在合法區(qū)間則提示消失,如果密碼不為空則登陸按鈕可點擊
雖然功能很小卻用到了不少的東西:

  • EditText失去焦點事件的監(jiān)聽
  • 獲取輸入的字符并且檢測長度
  • 當(dāng)用戶名不合法時出現(xiàn)提示
  • 設(shè)置登錄按鈕的不可點擊

接下來看一下源碼,為了是登陸界面更加美觀,我對登陸控件進行了圓形化處理,也就是開源醒目CircleImageView 項目主頁地址:https://github.com/hdodenhof/CircleImageView:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:tools="http://schemas.android.com/tools"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:orientation="vertical"
 android:background="@color/colorLogin"

 >

 <!-- Login progress -->
 <ProgressBar
 android:id="@+id/login_progress"
 
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_marginBottom="8dp"
 android:visibility="gone" />
 <RelativeLayout
 android:layout_width="match_parent"
 android:layout_height="180dp"

 android:id="@+id/head_img"
 >

 <de.hdodenhof.circleimageview.CircleImageView
  android:layout_width="80dp"
  android:layout_height="80dp"
  android:src="@mipmap/nav_head"
  android:layout_alignParentBottom="true"
  android:layout_centerHorizontal="true"
  android:layout_marginBottom="25dp" />
 </RelativeLayout>
 <LinearLayout
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
 android:paddingBottom="20dp"
 android:orientation="vertical">
 <EditText
  android:id="@+id/et_user"
  android:layout_width="match_parent"
  android:layout_height="60dp"
  android:hint="@string/userName"
  android:background="@color/colorLoginForm"
  android:layout_marginBottom="5dp"
  />
 <TextView
  android:id="@+id/tv_tip"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:textColor="@color/error"
  />
 <EditText
  android:id="@+id/et_pass"
  android:layout_width="match_parent"
  android:layout_height="60dp"
  android:background="@color/colorLoginForm"
  android:hint="@string/passWord"
  android:paddingTop="1dp"
  />
 </LinearLayout>
 <Button
 android:id="@+id/button"
 android:layout_width="match_parent"
 android:layout_height="50dp"
 android:background="@color/loginButton"
 android:text="@string/loginButton"
 android:textColor="@color/colorLoginForm"
 />

</LinearLayout>

名稱欄目:Android登陸界面用戶名檢測功能-創(chuàng)新互聯(lián)
當(dāng)前網(wǎng)址:http://www.chinadenli.net/article30/djcdpo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站制作標(biāo)簽優(yōu)化搜索引擎優(yōu)化自適應(yīng)網(wǎng)站微信小程序Google

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

商城網(wǎng)站建設(shè)