zoukankan      html  css  js  c++  java
  • 第一阶段冲刺02

      昨天干了什么:完成了登录注册界面的制作

      今天要做什么:完成顾客界面的理发店列表的制作。

      遇到什么困难:开始登录界面制作比较简单,所以困难目前还没有。

      以下是代码:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/index_background"
        android:orientation="vertical"
        >
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:gravity="center"
            android:paddingTop="50dp">
            <ImageView
                android:id="@+id/btn_iv_head"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@drawable/head"
                android:scaleX="1.2"
                android:scaleY="1.2"
                />
        </LinearLayout>
        <EditText
            android:id="@+id/et_registe_user"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="50dp"
            android:hint="输入用户名"
            android:maxLines="1"
            android:maxLength="8"
            android:inputType="text"
            android:textSize="25sp"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"/>
        <EditText
            android:id="@+id/et_registe_password"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/et_user"
            android:layout_marginTop="20dp"
            android:maxLength="8"
            android:hint="输入密码"
            android:maxLines="1"
            android:inputType="textPassword"
            android:textSize="25sp"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"/>
        <Button
            android:id="@+id/btn_registe1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="50dp"
            android:background="@color/indexcolor"
            android:text="注册并登录"
            android:textColor="#fff"
            android:textSize="24sp"
            android:height="60dp"
            android:layout_marginLeft="15dp"
            android:layout_marginRight="15dp"/>
    </LinearLayout>
    package com.example.lileme;
    
    import android.content.Intent;
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.widget.Button;
    import android.widget.EditText;
    import android.widget.LinearLayout;
    import android.widget.TextView;
    import android.widget.Toast;
    
    import com.example.lileme.Util.Toastutil;
    
    public class MainActivity extends AppCompatActivity {
        private Button mBnIndex;
        private EditText mBtnUser;
        private EditText mBtnPassword;
        private TextView mTvRegiste;/*注册*/
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            //获取登录按钮id
            mBnIndex=findViewById(R.id.btn_index);
            //获取账户id
            mBtnUser=findViewById(R.id.et_user);
            //获取密码id
            mBtnPassword=findViewById(R.id.et_password);
            //获取注册id
            mTvRegiste=findViewById(R.id.btn_registe);
            //点击登录
            mBnIndex.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
    
                    if(mBtnUser.getText().toString().equals("")){
                        Toastutil toastutil=new Toastutil(MainActivity.this,"用户名为空");
                    }
                    else if(mBtnPassword.getText().toString().equals("")){
                        Toastutil toastutil=new Toastutil(MainActivity.this,"密码为空");
                    }
                    else{
                        Intent intent=new Intent(MainActivity.this,CustomerActivity.class);
                        startActivity(intent);
                    }
                }
            });
            //点击注册跳转到注册页面RegisteActivity
            mTvRegiste.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent=new Intent(MainActivity.this,RegisteActivity.class);
                    startActivity(intent);
                }
            });
        }
    }
  • 相关阅读:
    网络通信与面向对象:对象化抽象、机制抽象、组合
    类、闭包、monand
    类型是数据的抽象
    投资的本质在控制贪婪
    bootstrap模态框modal使用remote动态加载内容,第二次加载显示相同内容解决办法
    bootstrap模态框关闭后清除模态框的数据
    Ajax发送请求等待时弹出模态框等待提示
    php foreach跳出本次/当前循环与终止循环方法
    PHP二维数组(或任意维数组)转换成一维数组的方法汇总(实用)
    bootstrap模态框动态赋值, ajax异步请求数据后给id为queryInfo的模态框赋值并弹出模态框(JS)
  • 原文地址:https://www.cnblogs.com/liyuchao/p/10821514.html
Copyright © 2011-2022 走看看