冲刺任务:完成app登录和注册页面的布局

activity_register.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".RegisterActivity"
android:background="#eeeeee"
>
<RelativeLayout
android:id="@+id/rl_registeractivity_top"
android:layout_width="match_parent"
android:layout_height="70dp"
android:background="@color/color_minefragment_top"
>
<ImageView
android:id="@+id/iv_registeractivity_back"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/ic_left_back"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:clickable="true"
android:onClick="onClick"
/> <TextView
android:id="@+id/tv_registeractivity_register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="注册"
android:textColor="#fff"
android:textSize="20dp"
android:layout_toRightOf="@+id/iv_registeractivity_back"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
/>
</RelativeLayout> <LinearLayout
android:id="@+id/ll_registeractivity_body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/rl_registeractivity_top"
android:layout_marginTop="10dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
>
<!--
具体内容部分
-->
<LinearLayout
android:id="@+id/ll_loginactivity_two"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/rl_registeractivity_top"
android:layout_marginTop="10dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/et_registeractivity_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="姓名"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"> <EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/et_registeractivity_id"
android:hint="学号"></EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/et_registeractivity_address"
android:hint="班级"></EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/et_registeractivity_phone"
android:hint="手机号码"></EditText>
</LinearLayout> </LinearLayout>
<!-- 验证码部分 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:layout_marginTop="10dp"
android:orientation="horizontal" >
<!-- 第四个文本编辑框 输入验证码 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_registeractivity_phoneCodes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:text="验证码:"/>
<EditText
android:id="@+id/et_registeractivity_phoneCodes"
android:layout_width="0dp"
android:layout_weight="3"
android:layout_height="50dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:hint="请输入4位验证码" /> <ImageView
android:id="@+id/iv_registeractivity_showCode"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_weight="1.5"
android:clickable="true"
android:onClick="onClick"
android:layout_marginTop="-10dp"
/>
</LinearLayout>
</LinearLayout>
<!-- 注册按钮 -->
<Button
android:id="@+id/bt_registeractivity_register"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="5dp"
android:background="@drawable/selector_loginactivity_button"
android:textColor="#fff"
android:text="注册"
android:onClick="onClick"
android:layout_marginTop="40dp"
/> <RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/rl_registeractivity_bottom"
android:layout_marginTop="10dp"
>
<TextView
android:layout_centerInParent="true"
android:text="注册即代表同意《用户协议》"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout> </LinearLayout> </RelativeLayout>

activity_login.xml

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#eeeeee"
tools:context=".loginActivity">
<!--
整体是相对布局,
在整体上方放三个东西,这三个东西也是相对布局
合在一起称为一个top
一个返回箭头 ←
两个文字显示 登录 注册
也就是说 login界面的上方长这个样子
← 登录 注册
下面是具体代码
-->
<RelativeLayout
android:id="@+id/rl_loginactivity_top"
android:layout_width="match_parent"
android:layout_height="70dp"
android:background="@color/color_minefragment_top" >
<ImageView
android:id="@+id/iv_loginactivity_back"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/ic_left_back"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:clickable="true"
android:onClick="onClick"
/> <TextView
android:id="@+id/tv_loginactivity_login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="登录"
android:textColor="#fff"
android:textSize="20dp"
android:layout_toRightOf="@+id/iv_loginactivity_back"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
/>
<TextView
android:id="@+id/tv_loginactivity_register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="注册"
android:textColor="#fff"
android:textSize="20dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_marginRight="30dp"
android:clickable="true"
android:onClick="onClick"
/>
</RelativeLayout>
<LinearLayout
android:id="@+id/ll_loginactivity_two"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/rl_loginactivity_top"
android:layout_marginTop="10dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tv_loginactivity_phone"
android:text="手机号码"
android:layout_marginRight="20dp"
></TextView>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/et_loginactivity_phone"
android:hint="输入手机号码"></EditText>
</LinearLayout>
</LinearLayout>
<!--
注意最后有一句: android:onClick="onClick"
这是应用了一个开源库,详细信息在loginActivity.java 中有注释
-->
<Button
android:id="@+id/bt_loginactivity_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_loginactivity_two"
android:layout_marginTop="10dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="@drawable/selector_loginactivity_button"
android:text="登录"
android:textColor="#fff"
android:gravity="center"
android:onClick="onClick"
/>
<!--
为了App的人性化,
想到有以下三种无法密码登录的异常处理情况
一、密码错误,重新输入
二、忘记密码,重新修改密码
三、不想注册,通过短信验证登录
密码输错了,重新输入,这个没啥说的
忘记密码应该以一个可以点击的文字出现在登录按钮的左下方
短信验证登录也以一个可以点击的文字出现在登录按钮的右下方
--> </RelativeLayout>

个人冲刺(一)——体温上报app(二阶段)的更多相关文章

  1. 个人作业——体温上报app(二阶段)

    Code.java package com.example.helloworld; import android.graphics.Bitmap; import android.graphics.Ca ...

  2. 个人冲刺(二)——体温上报app(二阶段)

    冲刺任务:完成app首页.第二页面和特殊情况的页面布局 activity_main.xml <?xml version="1.0" encoding="utf-8& ...

  3. 个人冲刺(一)——体温上报app(一阶段)

    任务:完成了体温上报app的整体页面布局 activity_main.xml <?xml version="1.0" encoding="utf-8"?& ...

  4. 个人作业--体温上报APP

    第一阶段目标: 1.要求增加用户注册功能,用户注册信息包括用户ID(学号).用户名(姓名),手机号码,用户单位(班级),用户班级四项基本信息,用户第一次注册后,用户姓名不用每次输入 . 2.体温上报界 ...

  5. 个人冲刺(六)——体温上报app(二阶段)

    冲刺任务:完成主页面功能 MainActivity.java package com.example.helloworld; import android.app.AlertDialog; impor ...

  6. 个人冲刺(七)——体温上报app(二阶段)

    冲刺任务:完成特殊情况功能 MoreActivity.java package com.example.helloworld; import android.content.Intent; impor ...

  7. 个人冲刺(五)——体温上报app(二阶段)

    冲刺任务:完成用户登录和随机验证码功能 loginActivity.java package com.example.helloworld; /** * 纯粹实现登录注册功能,其它功能都被注释掉了 * ...

  8. 个人冲刺(四)——体温上报app(二阶段)

    冲刺任务:完成用户注册功能和数据库类 RegisterActivity.java package com.example.helloworld; import android.content.Inte ...

  9. 个人冲刺(三)——体温上报app(二阶段)

    冲刺任务:完成用户类.温度数据和第二页面类的编写 User.java package com.example.helloworld; class User { private String usern ...

随机推荐

  1. 小程序踩坑记录-上传图片及canvas裁剪图片后上传至服务器

    最近在写微信小程序的上传图片功能,趟过了一些坑记录一下. 想要满足的需求是,从手机端上传图片至服务器,为了避免图片过大影响传输效率,需要把图片裁剪至适当大小后再传输 主要思路是,通过wx.choose ...

  2. Wepy-小程序踩坑记

    引言 用过原生开发的小程序也知道除了api 其他功能性的内容并不多对于需要做大型项目来说是比较难入手的,因此朋友推荐的wepy我就入坑鸟...这么一个跟vue的开发方式类似的框架,不过说起来跟vue类 ...

  3. 基于canvas和web audio实现低配版MikuTap

    导言 最近发掘了一个特别happy的网页小游戏--MikuTap.打开之后沉迷了一下午,导致开发工作没做完差点就要删库跑路了,还好boss瞥了我一眼就没下文了.于是第二天我就继续沉迷,随着一阵抽搐,这 ...

  4. PHP基于Thinkphp5的砍价活动相关设计

    近期我们公司项目里陆陆续续有很多为了招引新用户的活动推出,砍价的活动由我来负责,我们的项目是在微信浏览器里供用户浏览访问. 大概描述:进入砍价活动列表页选择有意向的商品,用户点击商品图片可以看到WEB ...

  5. 在TypeScript项目中进行BDD测试

    在TypeScript项目中进行BDD测试 什么是BDD? BDD(Behavior-Driven Design)是软件团队的一种工作方式,通过以下方式缩小业务人员和技术人员之间的差距: 鼓励跨角色协 ...

  6. javaweb之模糊查询

    模糊查询,主要通过sql语句来进行查询 一.dao层 加入模糊查询的方法 package dao; import java.sql.Connection; import java.sql.Prepar ...

  7. vue过滤金额自动补全小数点

    watch:{ //监听input双向绑定 balance(value) { //保留2位小数点过滤器 不四舍五入 var toFixedNum = Number(value).toFixed(3); ...

  8. String类 的基本用法

    1.String 对象的创建 String对象的创建有两种方式. 第1 种方式就是我们最常见的创建字符串的方式: String str1 = "Hello, 慕课网"; 第 2 种 ...

  9. 关于croptool无法裁剪分辩率过低的图片

    在使用croptool.js时,如果图片的分辨率过低,则无法裁剪超过分辨率的大小.比如说 function chooseImg(event){ var files = event.files || e ...

  10. 关于 background-image 渐变gradient()那些事!

    大家好,我是半夏,一个刚刚开始写文的沙雕程序员.如果喜欢我的文章,可以关注 点赞 加我微信:frontendpicker,一起学习交流前端,成为更优秀的工程师-关注公众号:搞前端的半夏,了解更多前端知 ...