• SCRUM第一天


    我们组整体实力比较弱,都是边学边做。

    第一天做了登录注册ui

     

     

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    package com.example.runapp;
     
     
    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.TextView;
    import android.widget.Toast;
     
     
    import com.example.runapp.MainActivity;
    import com.example.runapp.R;
    import com.example.runapp.RegisterActivity;
     
    public class LoginActivity extends AppCompatActivity {
        Button btnLogin;
        EditText editTextName,editTextPwd;
        TextView textRegister;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_login);
            btnLogin=this.findViewById(R.id.buttonLogin);
            editTextName=this.findViewById(R.id.editTextName);
            editTextPwd=this.findViewById(R.id.editTextPassword);
            textRegister=this.findViewById(R.id.textViewRegister);
            textRegister.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Register();
                }
            });
            btnLogin.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Login();
     
                }
            });
     
        }
        public void Register()
        {
            Intent intent=new Intent();
            intent.setClass(LoginActivity.this, RegisterActivity.class);
            startActivity(intent);
        }
        public void Login()
        {
            String editName=editTextName.getText().toString();
            String editPwd=editTextPwd.getText().toString();
            if(editName.equals("admit")&&editPwd.equals("admit"))
            {
                Toast.makeText(this,"登录成功!",Toast.LENGTH_LONG).show();
                Intent intent=new Intent();
                intent.setClass(LoginActivity.this, MainActivity.class);
                startActivity(intent);
            }
            else
            {
                Toast.makeText(this,"登录失败!",Toast.LENGTH_LONG).show();
            }
     
     
     
        }
    }

      

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    package com.example.runapp;
     
    import androidx.appcompat.app.AppCompatActivity;
     
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
     
    public class SplashActivity extends AppCompatActivity {
        Button btngo;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_splash);
            btngo=this.findViewById(R.id.buttongo);
            btngo.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent=new Intent();
                    intent.setClass(SplashActivity.this, LoginActivity.class);
                    startActivity(intent);
                }
            });
        }
    }

      

    复制代码
    <?xml version="1.0" encoding="utf-8"?>
    <FrameLayout 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=".SplashActivity">
    
        <ImageView
            android:id="@+id/imageView3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:scaleType="centerCrop"
            app:srcCompat="@drawable/run_splash"
            tools:layout_editor_absoluteX="0dp"
            tools:layout_editor_absoluteY="-16dp" />
    
        <TextView
            android:id="@+id/textView8"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal|bottom"
            android:layout_marginBottom="100dp"
            android:text="加油,奥利给!"
            android:textSize="20sp"
            android:textColor="@color/black"
            />
    
        <Button
            android:id="@+id/buttongo"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal|bottom"
            android:text="点击进入"
            android:background="#f83"/>
    
    </FrameLayout>
    复制代码
    复制代码
    <?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:layout_margin="5dp"
        tools:context=".RegisterActivity">
    
    
        <ImageView
            android:id="@+id/imageView2"
            android:layout_width="wrap_content"
            android:layout_height="200dp"
            app:srcCompat="@drawable/user_reg" />
    
        <TextView
            android:id="@+id/textView3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:layout_marginLeft="35dp"
            android:layout_below="@id/imageView2"
            android:text="账号" />
        <EditText
            android:id="@+id/editTextName"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true"
            android:layout_marginLeft="35dp"
            android:layout_marginRight="35dp"
            android:layout_marginTop="10dp"
            android:layout_below="@id/textView3"
    
            />
    
        <TextView
            android:id="@+id/textView4"
            android:layout_marginTop="10dp"
            android:layout_marginLeft="35dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/editTextName"
            android:text="密码" />
        <EditText
            android:id="@+id/editTextPassword"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/textView4"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true"
            android:layout_marginLeft="35dp"
            android:layout_marginRight="35dp"
            android:layout_marginTop="10dp"
            android:ems="10"
            android:inputType="textPassword" />
    
    
        <TextView
            android:id="@+id/textView6"
            android:layout_marginTop="10dp"
            android:layout_marginLeft="35dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/editTextPassword"
            android:text="确认密码" />
    
        <EditText
            android:id="@+id/editTextNoPassword"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true"
            android:layout_marginLeft="35dp"
            android:layout_marginRight="35dp"
            android:layout_marginTop="10dp"
            android:ems="10"
            android:layout_below="@id/textView6"
            android:inputType="textPassword" />
    
        <TextView
            android:id="@+id/textView7"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:layout_marginLeft="35dp"
            android:layout_below="@id/editTextNoPassword"
            android:text="密码提示" />
        <EditText
            android:id="@+id/editTextWarn"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true"
            android:layout_marginLeft="35dp"
            android:layout_marginRight="35dp"
            android:layout_marginTop="10dp"
            android:layout_below="@id/textView7"
    
            />
    
        <Button
            android:id="@+id/buttonRegister"
            android:layout_width="200dp"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="50dp"
            android:background="#f83"
            android:text="注册" />
    
    </RelativeLayout>
  • 相关阅读:
    error in ./src/views/demo/ueditor.vue Module build failed: Error: Cannot find module 'node-sass' Require stack:
    Spring Cloud Stream 定时任务消息延迟队列
    项目结构介绍
    Java面试题
    SpringBoot中用SpringSecurity实现用户登录并返回其拥有哪些角色
    MySQL索引优化
    MySQL中的执行计划explain
    SpringBoot之单体应用
    SpringBoot之SSM多模块应用
    Spring-aop面向切面编程笔记
  • 原文地址:https://www.cnblogs.com/w669399221/p/13083823.html
Copyright © 2020-2023  润新知