Android很好看的登陆界面(包含详细代码)

2023-11-18

一、这是我自己在做一个小项目的时候做的界面,在这里分享给大家,其实没什么东西,主要是利用了Material Design设计风格

1、在这里给大家安利一下Material Design设计风格,这个组件库的里面的组件和Android原生的组件的设计风格几乎相同,只不过里面加了很多个性化的设置,可以根据自己的需求去自行设计样式,里面的组件的各种性质,几乎可以满足我们的日常需求,还没有使用过的Android开发小伙伴可以去尝试一下。

2、效果图如下:

3、xml文件如下:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="#d3d3d3"
    android:orientation="vertical">

    <com.google.android.material.textview.MaterialTextView
        android:layout_marginTop="20dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textStyle="bold"
        android:layout_gravity="center"
        android:textSize="24sp"
        android:shadowColor="#ff000000"
        android:shadowRadius="10"
        android:shadowDx="10"
        android:shadowDy="10"
        android:text="Welcome use"/>

    <LinearLayout
        android:layout_marginTop="30dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="center">

        <de.hdodenhof.circleimageview.CircleImageView
            android:layout_width="70dp"
            android:layout_height="70dp"
            android:src="@drawable/a3"
            android:tooltipText="haha"/>

        <com.google.android.material.textview.MaterialTextView
            android:layout_marginLeft="10dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textStyle="bold"
            android:textSize="28sp"
            android:shadowColor="#ff000000"
            android:layout_gravity="center_vertical"
            android:text="智能基座"/>

    </LinearLayout>


    <com.google.android.material.card.MaterialCardView
        android:layout_width="match_parent"
        android:layout_height="460dp"
        android:layout_marginLeft="20dp"
        android:layout_marginTop="50dp"
        android:layout_marginRight="20dp"
        app:cardCornerRadius="20dp">

        <com.rengwuxian.materialedittext.MaterialEditText
            android:id="@+id/login_username"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="40dp"
            android:layout_marginRight="10dp"
            android:hint="Username"
            android:inputType="text"
            android:shadowColor="#ff000000"
            android:shadowDx="10"
            android:shadowDy="10"
            android:shadowRadius="10"
            android:singleLine="true"
            app:met_baseColor="#0056d3"
            app:met_clearButton="true"
            app:met_floatingLabel="highlight"
            app:met_floatingLabelText="Username"
            app:met_hideUnderline="true"
            app:met_iconLeft="@mipmap/person_central"
            app:met_iconPadding="10dp"
            app:met_maxCharacters="18"
            app:met_minCharacters="5"
            app:met_primaryColor="#0056d3" />

        <com.rengwuxian.materialedittext.MaterialEditText
            android:id="@+id/login_password"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="120dp"
            android:layout_marginRight="10dp"
            android:hint="Password"
            android:inputType="textPassword"
            android:shadowColor="#ff000000"
            android:shadowDx="10"
            android:shadowDy="10"
            android:shadowRadius="10"
            android:singleLine="true"
            app:met_baseColor="#0056d3"
            app:met_clearButton="true"
            app:met_floatingLabel="highlight"
            app:met_floatingLabelText="Password"
            app:met_hideUnderline="true"
            app:met_iconLeft="@mipmap/password"
            app:met_iconPadding="10dp"
            app:met_maxCharacters="18"
            app:met_minCharacters="5"
            app:met_primaryColor="#0056d3" />

        <!--        <com.google.android.material.button.MaterialButton-->
        <!--            android:layout_marginTop="75dp"-->
        <!--            android:layout_width="match_parent"-->
        <!--            android:layout_height="55dp"-->
        <!--            android:layout_marginLeft="10dp"-->
        <!--            android:layout_marginRight="10dp"-->
        <!--            android:text="Login"-->
        <!--            android:textAppearance="?android:attr/textAppearanceButton"-->
        <!--            android:layout_gravity="center"-->
        <!--            android:gravity="center"-->
        <!--            android:textSize="24sp"-->
        <!--            android:backgroundTint="#add8e6"-->
        <!--            android:textStyle="italic"-->
        <!--            app:cornerRadius="10dp"/>-->

        <!--        <com.google.android.material.button.MaterialButton-->
        <!--            android:layout_marginTop="150dp"-->
        <!--            android:layout_width="match_parent"-->
        <!--            android:layout_marginRight="10dp"-->
        <!--            android:layout_marginLeft="10dp"-->
        <!--            android:layout_height="55dp"-->
        <!--            android:text="sign up"-->
        <!--            android:textAppearance="?android:attr/textAppearanceButton"-->
        <!--            android:layout_gravity="center"-->
        <!--            android:gravity="center"-->
        <!--            android:textSize="24sp"-->
        <!--            android:textStyle="italic"-->
        <!--            android:backgroundTint="#add8e6"-->
        <!--            app:cornerRadius="10dp"/>-->

        <LinearLayout
            android:paddingLeft="15dp"
            android:paddingRight="10dp"
            android:layout_marginTop="200dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <CheckBox
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>
            <CheckedTextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="记住密码"/>
        </LinearLayout>

        <LinearLayout
            android:layout_marginTop="260dp"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:orientation="horizontal"
            android:gravity="center">

            <ImageView
                android:id="@+id/login_image"
                android:layout_width="0dp"
                android:layout_weight="2"
                android:src="@drawable/code1"
                android:layout_height="match_parent"
                android:layout_marginLeft="20dp"/>

            <com.rengwuxian.materialedittext.MaterialEditText
                android:id="@+id/login_code"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="3"
                android:gravity="center"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:hint="Code"
                android:inputType="text"
                android:singleLine="true"
                app:met_baseColor="#0056d3"
                app:met_floatingLabel="highlight"
                app:met_floatingLabelText="Code"
                android:textSize="20sp"
                app:met_hideUnderline="true"
                app:met_primaryColor="#0056d3" />
        </LinearLayout>


        <Button
            android:id="@+id/login_login"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="320dp"
            android:layout_marginRight="10dp"
            android:background="@drawable/btn_selector"
            android:text="Login"
            android:textSize="24sp"
            android:textStyle="italic" />

        <Button
            android:id="@+id/login_sign_up"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="380dp"
            android:layout_marginRight="10dp"
            android:background="@drawable/btn_selector"
            android:text="sign up"
            android:textSize="24sp"
            android:textStyle="italic" />
    </com.google.android.material.card.MaterialCardView>


    <com.google.android.material.textview.MaterialTextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:textStyle="bold"
        android:textSize="16sp"
        android:shadowColor="#ff000000"
        android:shadowRadius="20"
        android:gravity="center"
        android:shadowDx="20"
        android:shadowDy="20"
        android:layout_marginBottom="0dp"
        android:text="最终解释权归华为智能基座"/>

</LinearLayout>

 你们的支持,就是我分享的动力,希望你们一键三连啊,谢谢!!!!

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Android很好看的登陆界面(包含详细代码) 的相关文章

随机推荐

  • 机器学习基础 第三章 分类算法

    1 线性分类器 感知器 1 1 感知器 有如图1 1所示的两类数据希望找到 如果想把他们分开 最简单的方法就是用图中的绿线将它们分开 显然绿线的方程为 t 0 1x 1y 1 1 1 t omega 0 omega 1 x omega 1
  • Linux的缓存内存(cache memory)

    PS 为什么Linux系统没运行多少程序 显示的可用内存这么少 其实Linux与Win的内存管理不同 会尽量缓存内存以提高读写性能 通常叫做Cache Memory 为什么Linux系统没运行多少程序 显示的可用内存这么少 其实Linux与
  • PyTorch模型训练集正常收敛,但验证集准确率稳定在10%并保持不变

    问题描述 训练过程中遇到的一个Bug 可能是跟Torch本身有关 如下图和题目所示 经过多轮训练 训练准确率开始收敛 但是验证准确率保持在10 左右不变 排查手册 一般来说这表示模型本身可能存在问题 下面列出一个排查手册 检查是否是数据问题
  • C#中的DataGridView中添加按钮并操作数据

    目录 背景 一 在DataGridView中显示需要的按钮 二 给DataGridView添加事件 可以通过按钮来操作数据库 三 在按钮上鼠标箭头变成小手样式 四 总结 背景 最近在项目中有需求需要在DataGridView中添加 删除 修
  • 十进制数转8421BCD码

    十进制数转8421BCD码就是把十进制数字每一位都用4个二进制位所组成的数字代替 十进制数 8421码 余3码 0 0000 0011 1 0001 0100 2 0010 0101 3 0011 0110 4 0100 0111 5 01
  • 拿下60亿流量的《惊雷》都是哪些人在听?python帮你统计出来

    前言 本文的文字及图片来源于网络 仅供学习 交流使用 不具有任何商业用途 版权归原作者所有 如有问题请及时联系我们以作处理 作者 听不来喊麦的C君 PS 如果你处于想学Python或者正在学习Python Python的教程不少了吧 但是是
  • phpstudy安装及简单使用

    前言 我们都知道如果要搭建网站 就需要借助Apache或者Nginx的帮助 当然也少不了数据库的使用 我们自行下载Apache和MySQL等数据库 需要我们进行配置才能使用 这对于一些小白非常的不方便 而且出现一些错误不会解决可能会耽搁很长
  • MySQL执行顺序

    mysql执行顺序如下 1 from 阶段 2 where 阶段 3 group by 阶段 4 having 阶段 5 select 阶段 6 order by 阶段 7 limit 阶段 问题 为什么别名不可以使用在where中 但可以
  • 队列以及Java实现

    了解队列 在我们的现实生活中会经常看见队列的出现 如 排队买奶茶 叫号服务和餐厅的排号 我们去餐厅准备吃饭时 由于人多只能排队等待就餐或换一家人少的餐厅 餐厅为了让服务更加的好 就会使用排队系统 排队系统完全模拟了人群排队全过程 通过取票进
  • el-cascader 懒加载回显问题解决

    解决思路 在页面初始化技术后根据组件的ref 直接给组件的inputValue和inputTerxt赋label的值 前提是你之前已经保存过这个值 ref的部分属性 代码
  • 靠Python做副业一年买了房:未来五年的风口行业 ,90%的人都不知道

    程序开发领域有这样一句话 人生苦短 我用Python 这本是开发者大佬Bruce Eckel的金句 Life is short you need Python 有趣的是 很多人并非专职程序员 但却把这句话奉为神谕 所以Python究竟有什么
  • Python中MNE库的脑电地形图绘制

    脑电地形图在进行和 源 相关的分析时很有用 可以直观的看出各个电极的激活情况以及其随时间的变化 在标准的脑电数据中都是有电极的坐标位置的 会用EEGLab的可能对这块比较熟悉了 实际MNE库中也有相关的定义和实现 可以导入外部的电极数据 或
  • top 内存耗用:VSS/RSS/PSS/USS

    转载 http blog csdn net adaptiver article details 7084364 Terms VSS Virtual Set Size 虚拟耗用内存 包含共享库占用的内存 RSS Resident Set Si
  • Python-OpenCv读取,输出图像

    读取图像 调用imread函数生成像素点矩阵 img cv2 imread lll jpg 读图片 print函数查看矩阵 print img 输出图像 调用imshow函数 新建一个show py文件写输出函数分别调用 resize函数设
  • C#中Ilist与list的区别小结

    常见问题 Ilist lt gt 本身只是一个泛型接口 既然是接口当然不能实例化 只能用如下方法 IList
  • python的print打印颜色设置

    1 顺序 显示方式 前景颜色 背景颜色 2 顺序非固定 但尽量按默认书写方式 3 也可以在input中输出使用 4 格式 print 033 显示方式 前景颜色 背景颜色m 033 0m 显示方式 意义 显示方式 默认 0 高亮显示 1 下
  • 读书笔记:Bi-Directional Cascade Network for Perceptual Edge Detection

    目录 摘要 1 介绍 2 相关工作 3 方法 3 1公式 3 2BDCN的架构 3 3网络训练 4 实验 4 1数据集 摘要 利用多尺度表示对于提高不同尺度对象的边缘检测至关重要 为了利用多尺度提取边缘 我们提出了一种全向级联网络 BDCN
  • 仿网页列表的实现

    序言 实现思路 代码实现 效果展现 总结 序言 最近遇到了一项需求 用Android实现网页中的列表效果 首先我便想到了用ListView的方式来实现 由于网页的表格数据通常都是以一行的形式展现的 因此 我把需要展现的数据放在了一行 可是需
  • python中的tcp/ip连接

    参考博客 https blog csdn net c123 sensing article details 81563702 服务端的代码 usr bin python coding UTF 8 import socket sock soc
  • Android很好看的登陆界面(包含详细代码)

    一 这是我自己在做一个小项目的时候做的界面 在这里分享给大家 其实没什么东西 主要是利用了Material Design设计风格 1 在这里给大家安利一下Material Design设计风格 这个组件库的里面的组件和Android原生的组