Android微信登录页面实现

利用Android实现微信手机端的登录页面,对于登录的输入做了一些的条件限制诸如,非空,长度限制等;

效果图如下:

xml文件代码:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"tools:context=".MainActivity"><TextViewandroid:id="@+id/nextx"android:layout_width="match_parent"android:layout_height="40dp"android:layout_marginBottom="20dp"android:paddingLeft="10dp"android:textSize="29sp" /><TextViewandroid:layout_width="match_parent"android:layout_height="50dp"android:layout_marginTop="10dp"android:paddingLeft="10dp"android:gravity="center"android:text="手机号登录"android:textSize="29sp" /><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="50dp"android:paddingTop="20dp"android:gravity="left"android:orientation="horizontal"><TextViewandroid:layout_width="100dp"android:layout_height="50dp"android:paddingLeft="10dp"android:text="国家/地区"android:textSize="18sp" /><TextViewandroid:layout_width="200dp"android:layout_height="50dp"android:paddingLeft="10dp"android:text="中国大陆(+86)"android:textColor="#11E811"android:textSize="18sp" /></LinearLayout><LinearLayoutandroid:orientation="horizontal"android:layout_width="match_parent"android:layout_height="58dp"android:layout_marginRight="8dp"android:layout_marginBottom="20dp"><TextViewandroid:layout_width="100dp"android:layout_height="match_parent"android:paddingLeft="10dp"android:layout_marginRight="10dp"android:paddingTop="15dp"android:text="手机号"android:textSize="18sp" /><EditTextandroid:id="@+id/phone"android:layout_width="310dp"android:layout_height="match_parent"android:paddingTop="8dp"android:hint="请输入手机号" /></LinearLayout><LinearLayoutandroid:orientation="horizontal"android:layout_width="match_parent"android:layout_height="58dp"android:layout_marginRight="8dp"android:layout_marginBottom="20dp"><TextViewandroid:layout_width="100dp"android:layout_height="match_parent"android:paddingLeft="10dp"android:layout_marginRight="10dp"android:paddingTop="15dp"android:text="密码"android:textSize="18sp" /><EditTextandroid:id="@+id/pwd"android:layout_width="310dp"android:layout_height="match_parent"android:paddingTop="8dp"android:inputType="textPassword"android:hint="请输入密码" /></LinearLayout><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:paddingLeft="10dp"android:layout_marginBottom="10dp"android:text="用微信号/QQ号/邮箱登录"android:textSize="14sp" /><Buttonandroid:id="@+id/next"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginLeft="10dp"android:layout_marginRight="10dp"android:background="#0FC814"android:paddingTop="10dp"android:paddingBottom="10dp"android:text="登录"android:textColor="#FFFFFF" /><TextViewandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginTop="400dp"android:gravity="center_horizontal"android:paddingTop="10dp"android:text="找回密码  |  紧急冻结  |  微信安全中心" /></LinearLayout>

 java控制代码:

package com.d.jisuanqi;import androidx.appcompat.app.AppCompatActivity;import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;public class MainActivity extends AppCompatActivity {private EditText pwd,phone;private Button button;String account,password;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);pwd=findViewById(R.id.pwd);phone=findViewById(R.id.phone);button=findViewById(R.id.next);button.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View view) {password=pwd.getText().toString();account=phone.getText().toString();if (password.equals("")||account.equals("")) {Toast.makeText(MainActivity.this, "请您将信息填写完整!", Toast.LENGTH_LONG).show();}else if(password.length()<6||account.length()<6){Toast.makeText(MainActivity.this, "密码和账号长度在6位及以上请检查", Toast.LENGTH_LONG).show();}else{Intent intent=new Intent();intent.setClass(MainActivity.this,Main2Activity.class);startActivity(intent);}}});}
}

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/37199.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

分享一个基于GPT-3.5 Turbo的开源项目,界面简洁大气,反应速度快

今天在github又发现一个国内的大神开源的chatGPT项目。先看看整体的效果如何吧。 这个项目是基于OpenAI GPT-3.5 Turbo API 的demo。 本地部署 环境准备 安装node 由于该项目是使用node开发&#xff0c;所以&#xff0c;在部署之前先要安装好node环境。检查您的开发环境和部…

一款反应速度完全碾压chatgpt3.5turbo的软件 curor,直接运行

1、软件简介 Build Software. Fast.是一款可以在编辑器中使用 openAI GPT-4 模型编写的软件 官网地址&#xff1a;https://www.cursor.so/ 2.安装方法 不用安装直接运行exe3.使用方法 CTRLK(生成代码)CTRLL(对话功能)

OpenAI ChatGPT3.5-turbo实际解决问题能力评测

OpenAI ChatGPT3.5-turbo实际解决问题能力评测 ​ 程序员在coding的时候会经常遇到需要查阅资料的情况&#xff0c;最好的结果是直接能拿到一份好用的demo版本code&#xff0c;本次我们来评测&#xff1a;bing搜索和chatGPT3.5&#xff0c;解决实际问题&#xff1a;“html 图片…

程序员“摸鱼”神器,GitHub Copilot“凭本事”完全免费

上周Microsoft 365 Copilot的发布会上几段演示视频让朋友圈沸腾了一整天&#xff0c;颠覆&#xff0c;失业&#xff0c;工业革命刷屏&#xff0c;普遍的焦虑中有工作中重度依赖office的朋友表示如果功能都是真的&#xff0c;那么确实可以节约出很多时间摸鱼&#xff0c;但是立马…

AI人工智能时代真的到来了吗?

近一个月来&#xff0c;关于AI人工智能的话题此起彼伏&#xff0c;先有OpenAI发布GPT-4&#xff0c;后有百度推出文心一言&#xff0c;再有微软把GPT-4接入Office全家桶并命名为“Microsoft 365 Copilot”&#xff0c;除此之外&#xff0c;微软Bing还上线了AI绘图功能、谷歌开放…

文字生万物,AI极简史

AI 算法就像一个人类婴儿 哈罗德科恩花了 42 年把 AARON 铸成“另一半自己”。它是一段被画家造出来的计算机程序&#xff0c;或许也可以叫做 AI 系统。先是花了 20 年学会黑白简笔画&#xff0c;1995 年&#xff0c;它第一次表演上色&#xff0c;以一个庞大的机器模样&#xf…

WindTerm使用(暂停更新)

作为一个经常和代码以及服务器打交道的人&#xff0c;连接远程服务器所使用的工具肯定是越方便越好。目前&#xff0c;我使用的是xshell5和MobaXterm两个。Xshell最新的是7&#xff0c;破解版的我懒得去找&#xff0c;那xshell7免费使用一段时间后&#xff0c;就得付费&#xf…

【论文速递】ACM MM 2022 - 基于统一对比学习框架的新闻多媒体事件抽取

【论文速递】ACM MM 2022 - 基于统一对比学习框架的新闻多媒体事件抽取 【论文原文】&#xff1a;Multimedia Event Extraction From News With a Unified Contrastive Learning Framework 【作者信息】&#xff1a;Liu, Jian and Chen, Yufeng and Xu, Jinan 论文&#xff…

JoVE微生物组专刊征稿,写方法拍视频教程发SCI(宏基因组公众号专属福利)

JoVE 视频实验杂志 官网&#xff1a;https://www.jove.com/ 包括上万个实验和分析方法视频&#xff0c;还有几十个领域的数百个专业视频教程资源。 这个杂志被SCI收录了吗&#xff1f;必须的。杂志在Web of Science中JCR信息如下&#xff1a; 2年影响因子 1.1&#xff0c;5年影…

2020年, video captioning论文汇总

目录 CVPR2020&#xff1a;ORG-TRLCVPR2020&#xff1a;STG-KDTIP2020&#xff1a;OSTGTPAMI2020&#xff1a;SibNet&#xff08;MM2018&#xff09;WACV2020&#xff1a;DSDWACV2020&#xff1a;STaTS CVPR2020&#xff1a;ORG-TRL 题目 Object Relational Graph with Teache…

深度学习顶会论文投稿策略7步走(附资料)

科研论文&#xff0c;不同于毕业论文之处在于——科研论文是根据有价值的生产实践或科研课题写作的&#xff0c;具有原创性和独到性的论文。 在学术界&#xff0c;有人写论文是为了升硕士&#xff0c;升博士或者研究生博士顺利毕业。毕竟在学术界论文是工作和科研水平的直观体现…

最新最全论文合集——AAAI 历年最佳论文汇总

AMiner平台&#xff08;https://www.aminer.cn&#xff09;由清华大学计算机系研发&#xff0c;拥有我国完全自主知识产权。平台包含了超过2.3亿学术论文/专利和1.36亿学者的科技图谱&#xff0c;提供学者评价、专家发现、智能指派、学术地图等科技情报专业化服务。系统2006年上…

论文分享:2020小样本学习综述

目录 题目与文章脉络S1 介绍1.1 FSL1.2 FSL应用场景1.3 FSL术语定义 S2 概述2.1 定义&分类&应用2.2 相关机器学习问题2.3 FSL核心问题2.4 FSL方法分类2.5 FSL方法研究现状 S3 数据3.1 数据扩充方法3.2 数据扩充方法的GAP S4 模型4.1 模型选择方法4.2 模型选择方法的GAP…

MICCAI2019论文分享 PART①

刚刚结束的 MICCAI2019 会议的论文集分为6个部分&#xff0c;这段时间刷了一遍 Part I&#xff0c;在这儿和大家做一个简单的分享交流 由于本人主要专注于分割领域和半监督弱监督等学习策略&#xff0c;下面给出的综述可能多涉及该方向。选出的文章主要突出其中的闪光点&#…

写论文有哪些神网站?

来源&#xff1a;https://www.zhihu.com/question/35931336 编辑&#xff1a;深度学习与计算机视觉 声明&#xff1a;仅做学术分享&#xff0c;侵删 作者&#xff1a;匿名用户https://www.zhihu.com/question/35931336/answer/66552275 1.学术网站大全推荐理由&#xff1a;包含…

分享几个写英文论文的网页和软件

多个批量修改英语写作语法错误的工具可以修改英文文章里的语法错误&#xff0c;修改效率极高&#xff0c;而且都是免费的。&#xff1a; 1.1Checker&#xff0c;使用地址&#xff1a;1Checker http://www.1checker.com/Home/Index 2.ginger http://www.gingersoftware.com/&…

你写论文时发现了哪些神网站?

周不润 &#xff0c;神经科学 收录于 编辑推荐 • 18860 人赞同 神网站算不上&#xff0c;都是一些为写作带来便利的网站。而且作为一些最常用网站的替代品&#xff0c;这些网站有的更精确&#xff0c;有的更便捷。 &#xff08;16.02.27 更新&#xff09; 以下内容包括&#…

【论文推荐】了解《视频预测》必看的6篇论文(附打包下载地址)

论文推荐 “SFFAI135期来自中国科学院计算技术研究所博士在读的常峥推荐的文章主要关注于计算机视觉的视频预测领域&#xff0c;你可以认真阅读讲者推荐的论文&#xff0c;来与讲者及同行线上交流哦。” 关注文章公众号 回复"SFFAI135"获取本主题精选论文 01 推荐理由…

MICCAI2021论文合集

2021年的MICCAI论文合集来了&#xff01;&#xff01;&#xff01; 在官网下完了以下合集&#xff1a; 百度网盘链接&#xff1a; 如果有人搞Alzheimer disease classification的可以一起交流&#xff01;&#xff01;&#xff01; 链接2022.08.19更新&#xff1a; 链接&am…

我是如何从头写一篇顶级论文的

Datawhale干货 作者&#xff1a;重剑无锋知乎&#xff0c;剑桥大学&#xff0c;编辑&#xff1a;极市平台 原文丨https://zhuanlan.zhihu.com/p/538681254 极市导读 关于一篇顶会论文是如何产生的这件事—且看作者为你娓娓道来&#xff0c;如何从一形成routine的日常科研生活…