Android Studio 学生课程签到系统
目录
一、登录界面
二、新用户注册界面
三、忘记密码界面
四、用户信息界面
五、课程签到界面
学生签到系统通过账号密码登录,如果没有账号可以通过注册来创建一个新用户,如果是忘记了密码也可以通过忘记密码来找回密码(因为这个系统我没有连接数据库,创建新用户和找回密码是无法实现的),登录成功后就可以看到个人用户信息,然后对相应的课程进行签到。
一、登录界面
<TextViewandroid:id="@+id/tv_1_Login"android:layout_width="match_parent"android:layout_height="50dp"android:text="2022年4月18日物联网201考勤情况:李x迟到,李x旷课,李x上课睡觉"android:textSize="35dp"android:background="#F40202"android:singleLine="true"android:ellipsize="marquee"android:marqueeRepeatLimit="marquee_forever"android:focusable="true"android:focusableInTouchMode="true"/><TextViewandroid:layout_width="match_parent"android:layout_height="100dp"android:text="物联网201考勤系统"android:textSize="45dp"android:gravity="center"android:textColor="#F60909"android:layout_marginTop="50dp"/><RelativeLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:gravity="center"android:layout_gravity="center"android:layout_marginTop="130dp"><TextViewandroid:id="@+id/tv_2_Login"android:layout_width="wrap_content"android:layout_height="32dp"android:text="账号:"android:textSize="20dp"android:gravity="center"android:layout_marginTop="2dp"/><EditTextandroid:id="@+id/et_1_Login"android:layout_width="160dp"android:layout_height="40dp"android:layout_marginTop="2dp"android:layout_toRightOf="@id/tv_2_Login"android:gravity="center"android:hint="手机号或邮箱"android:textSize="15dp" /><TextViewandroid:id="@+id/tv_3_Login"android:layout_width="wrap_content"android:layout_height="32dp"android:layout_below="@id/tv_2_Login"android:layout_marginTop="14dp"android:gravity="center"android:text="密码:"android:textSize="20dp" /><EditTextandroid:id="@+id/et_2_Login"android:layout_width="160dp"android:layout_height="40dp"android:layout_below="@id/tv_2_Login"android:layout_marginTop="14dp"android:layout_toRightOf="@id/tv_3_Login"android:gravity="center"android:textSize="15dp" /><Buttonandroid:id="@+id/bt_1_Login"android:layout_width="wrap_content"android:layout_height="50dp"android:layout_below="@id/tv_3_Login"android:layout_marginLeft="90dp"android:layout_marginTop="20dp"android:background="@drawable/bt_1_solid_blue"android:gravity="center"android:text="登录"android:textSize="27dp" /><Buttonandroid:id="@+id/bt_2_Login"android:layout_width="65dp"android:layout_height="32dp"android:layout_toRightOf="@id/et_1_Login"android:background="@drawable/bt_2_solid_yellow"android:text="注册"android:textSize="15dp"/><Buttonandroid:id="@+id/bt_3_Login"android:layout_width="67dp"android:layout_height="32dp"android:layout_below="@id/bt_2_Login"android:layout_marginTop="15dp"android:layout_toRightOf="@id/et_2_Login"android:background="@drawable/bt_3_stroke_yellow"android:text="忘记密码"android:textSize="15dp" /><CheckBoxandroid:id="@+id/cb_1_Login"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_below="@id/bt_1_Login"android:layout_marginLeft="65dp"android:layout_marginTop="90dp"android:background="@drawable/cb_1_stroke_blue"android:checked="true"android:text="我同意《xxx协议》"android:textColor="#9F9D9D"android:textSize="12dp" /></RelativeLayout>
public class Login_Screen extends AppCompatActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_login_screen);CheckBox cb_1_Login=findViewById(R.id.cb_1_Login);//复选框,在xml里面我设置为默认勾选cb_1_Login.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);//设置下划线TextView tv_1=findViewById(R.id.tv_1_Login);tv_1.setSelected(true);//设置跑马灯效果String user="admin";//设置用户名String passorward="123456";//设置密码EditText et_1_Login=findViewById(R.id.et_1_Login);//连接的是用户名编辑框EditText et_2_Login=findViewById(R.id.et_2_Login);//连接的是密码编辑框Button bt_1=findViewById(R.id.bt_1_Login);//连接的是登录按钮bt_1.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View view) {if (cb_1_Login.isChecked()){String user_code = et_1_Login.getText().toString();//获取输入的用户名String passorward_code = et_2_Login.getText().toString();//获取输入的密码if (user_code.isEmpty()){Toast.makeText(Login_Screen.this,"请输入账号",Toast.LENGTH_SHORT).show();}else {if (passorward_code.isEmpty()){Toast.makeText(Login_Screen.this,"请输入密码",Toast.LENGTH_SHORT).show();}else {if (user_code.equals(user)){if (passorward_code.equals(passorward)){Intent intent = new Intent(Login_Screen.this, User_Screen.class);startActivity(intent);}else {Toast.makeText(Login_Screen.this,"密码错误,请重新输入",Toast.LENGTH_SHORT).show();}}else {Toast.makeText(Login_Screen.this,"账号错误,请重新输入",Toast.LENGTH_SHORT).show();}}}}else {Toast.makeText(Login_Screen.this,"请勾选协议",Toast.LENGTH_SHORT).show();}}});Button bt_2_Login=findViewById(R.id.bt_2_Login);//注册按钮的监听bt_2_Login.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View view) {Intent intent = new Intent(Login_Screen.this, Registered.class);startActivity(intent);}});Button bt_3_Login=findViewById(R.id.bt_3_Login);//忘记密码按钮的监听bt_3_Login.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View view) {Intent intent = new Intent(Login_Screen.this, Forgot_Password.class);startActivity(intent);}});}
}
我的登录系统是必须用户和密码以及勾选了用户协议才能登录成功
二、新用户注册界面
<TextViewandroid:layout_width="match_parent"android:layout_height="60dp"android:text="新用户注册界面"android:background="#A6F0FA"android:textSize="40dp"android:gravity="center"android:layout_gravity="center"></TextView>
<RelativeLayoutandroid:layout_width="300dp"android:layout_height="wrap_content"android:layout_gravity="center"android:layout_marginTop="40dp"><TextViewandroid:id="@+id/tv_1_Registered"android:layout_width="wrap_content"android:layout_height="40dp"android:text=" 昵称:"android:textSize="20dp"android:layout_marginTop="5dp"></TextView><EditTextandroid:id="@+id/et_1_Registered"android:layout_width="168dp"android:layout_height="40dp"android:layout_marginLeft="10dp"android:layout_toRightOf="@id/tv_1_Registered"android:background="@drawable/ed_1_stroke_blue"></EditText><TextViewandroid:id="@+id/tv_2_Registered"android:layout_width="wrap_content"android:layout_height="40dp"android:text=" 性别:"android:textSize="20dp"android:layout_below="@id/tv_1_Registered"android:layout_marginTop="5dp"></TextView><RadioGroupandroid:id="@+id/rg_1_Registered"android:layout_width="wrap_content"android:layout_height="40dp"android:layout_below="@id/et_1_Registered"android:layout_marginLeft="10dp"android:layout_marginTop="5dp"android:layout_toRightOf="@id/tv_2_Registered"android:orientation="horizontal"><RadioButtonandroid:id="@+id/rb_1_Registered"android:layout_width="40dp"android:layout_height="wrap_content"android:layout_gravity="center"android:layout_marginLeft="3dp"android:background="@drawable/rb_1_solid_blue"android:button="@null"android:gravity="center"android:text="男"android:textSize="20dp"></RadioButton><RadioButtonandroid:id="@+id/rb_2_Registered"android:layout_width="40dp"android:layout_height="wrap_content"android:layout_gravity="center"android:layout_marginLeft="62dp"android:background="@drawable/rb_1_solid_blue"android:button="@null"android:gravity="center"android:text="女"android:textSize="20dp"></RadioButton></RadioGroup><TextViewandroid:id="@+id/tv_3_Registered"android:layout_width="wrap_content"android:layout_height="40dp"android:text=" 密码:"android:textSize="20dp"android:layout_below="@id/tv_2_Registered"android:layout_marginTop="5dp"></TextView><EditTextandroid:id="@+id/et_2_Registered"android:layout_width="168dp"android:layout_height="40dp"android:layout_below="@id/rg_1_Registered"android:layout_marginLeft="10dp"android:layout_marginTop="5dp"android:layout_toRightOf="@id/tv_3_Registered"android:background="@drawable/ed_1_stroke_blue"></EditText><TextViewandroid:id="@+id/tv_4_Registered"android:layout_width="wrap_content"android:layout_height="40dp"android:layout_below="@id/tv_3_Registered"android:layout_marginTop="5dp"android:text="确认密码:"android:layout_marginLeft="0dp"android:textSize="20dp"></TextView><EditTextandroid:id="@+id/et_3_Registered"android:layout_width="168dp"android:layout_height="40dp"android:layout_below="@id/et_2_Registered"android:layout_marginLeft="9dp"android:layout_marginTop="5dp"android:layout_toRightOf="@id/tv_4_Registered"android:background="@drawable/ed_1_stroke_blue"></EditText><TextViewandroid:id="@+id/tv_5_Registered"android:layout_width="wrap_content"android:layout_height="40dp"android:text=" 手机号:"android:textSize="20dp"android:layout_below="@id/tv_4_Registered"android:layout_marginTop="5dp"></TextView><EditTextandroid:id="@+id/et_4_Registered"android:layout_width="168dp"android:layout_height="40dp"android:layout_below="@id/et_3_Registered"android:layout_marginLeft="10dp"android:layout_marginTop="5dp"android:layout_toRightOf="@id/tv_5_Registered"android:background="@drawable/ed_1_stroke_blue"></EditText><TextViewandroid:id="@+id/tv_6_Registered"android:layout_width="wrap_content"android:layout_height="40dp"android:text=" 验证码:"android:textSize="20dp"android:layout_below="@id/tv_5_Registered"android:layout_marginTop="5dp"></TextView><EditTextandroid:id="@+id/et_5_Registered"android:layout_width="168dp"android:layout_height="40dp"android:layout_below="@id/et_4_Registered"android:layout_toRightOf="@id/tv_6_Registered"android:layout_marginLeft="10dp"android:layout_marginTop="5dp"android:background="@drawable/ed_1_stroke_blue"></EditText><TextViewandroid:id="@+id/tv_10_Registered"android:layout_width="wrap_content"android:layout_height="40dp"android:text=" 邮箱:"android:textSize="20dp"android:layout_below="@id/tv_6_Registered"android:layout_marginTop="5dp"></TextView><EditTextandroid:id="@+id/et_6_Registered"android:layout_width="168dp"android:layout_height="40dp"android:layout_below="@id/et_5_Registered"android:layout_marginLeft="10dp"android:layout_marginTop="5dp"android:layout_toRightOf="@id/tv_10_Registered"android:background="@drawable/ed_1_stroke_blue"></EditText><TextViewandroid:id="@+id/tv_11_Registered"android:layout_width="wrap_content"android:layout_height="40dp"android:text="出生日期:"android:textSize="20dp"android:layout_below="@id/tv_10_Registered"android:layout_marginTop="5dp"></TextView><EditTextandroid:id="@+id/et_7_Registered"android:layout_width="168dp"android:layout_height="40dp"android:layout_below="@id/et_6_Registered"android:layout_marginLeft="9dp"android:layout_marginTop="5dp"android:layout_toRightOf="@id/tv_11_Registered"android:background="@drawable/ed_1_stroke_blue"></EditText><Buttonandroid:id="@+id/bt_1_Registered"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_below="@id/et_7_Registered"android:layout_marginLeft="110dp"android:layout_marginTop="15dp"android:background="@drawable/bt_1_solid_blue"android:text="立即注册"android:textSize="30dp"></Button><TextViewandroid:id="@+id/tv_7_Registered"android:layout_width="wrap_content"android:layout_height="40dp"android:text="*"android:textSize="30dp"android:textColor="#FB0000"android:gravity="center"android:layout_toRightOf="@id/et_1_Registered"android:layout_marginLeft="10dp"></TextView><TextViewandroid:id="@+id/tv_8_Registered"android:layout_width="wrap_content"android:layout_height="40dp"android:text="*"android:textSize="30dp"android:textColor="#FB0000"android:gravity="center"android:layout_below="@id/tv_7_Registered"android:layout_toRightOf="@id/et_2_Registered"android:layout_marginLeft="10dp"android:layout_marginTop="5dp"></TextView><TextViewandroid:id="@+id/tv_9_Registered"android:layout_width="wrap_content"android:layout_height="40dp"android:text="*"android:textSize="30dp"android:textColor="#FB0000"android:gravity="center"android:layout_below="@id/tv_4_Registered"android:layout_toRightOf="@id/et_4_Registered"android:layout_marginLeft="10dp"android:layout_marginTop="5dp"></TextView><TextViewandroid:id="@+id/tv_12_Registered"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_below="@id/bt_1_Registered"android:layout_marginLeft="124dp"android:layout_marginTop="5dp"android:text="带*项为必填项"android:textColor="#9F9D9D"android:textSize="15dp"></TextView><CheckBoxandroid:id="@+id/cb_1_Registered"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_below="@id/tv_12_Registered"android:layout_marginLeft="95dp"android:checked="true"android:text="我同意《xxx协议》"android:textSize="15dp"android:background="@drawable/cb_1_stroke_blue"></CheckBox>
</RelativeLayout>
public class Registered extends AppCompatActivity {@RequiresApi(api = Build.VERSION_CODES.S)@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_registered);TextView tv_12_Registered = findViewById(R.id.tv_12_Registered);tv_12_Registered.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);RadioButton rb_1_Registered=findViewById(R.id.rb_1_Registered);RadioButton rb_2_Registered=findViewById(R.id.rb_2_Registered);Button bt_1_Registered=findViewById(R.id.bt_1_Registered);CheckBox cb_1_Registered=findViewById(R.id.cb_1_Registered);EditText et_1_Registered=findViewById(R.id.et_1_Registered);EditText et_2_Registered=findViewById(R.id.et_2_Registered);EditText et_3_Registered=findViewById(R.id.et_3_Registered);EditText et_4_Registered=findViewById(R.id.et_4_Registered);EditText et_5_Registered=findViewById(R.id.et_5_Registered);EditText et_6_Registered=findViewById(R.id.et_6_Registered);EditText et_7_Registered=findViewById(R.id.et_7_Registered);bt_1_Registered.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View view) {if (cb_1_Registered.isChecked()){String name = et_1_Registered.getText().toString();String phonenumber = et_4_Registered.getText().toString();Log.e("昵称",name);if (rb_1_Registered.isChecked()){Log.e("性别",rb_1_Registered.getText().toString());}else if(rb_2_Registered.isChecked()){Log.e("性别",rb_2_Registered.getText().toString());}Log.e("密码",et_2_Registered.getText().toString());Log.e("确认密码",et_3_Registered.getText().toString());Log.e("手机号",phonenumber);Log.e("验证码",et_5_Registered.getText().toString());Log.e("邮箱",et_6_Registered.getText().toString());Log.e("出生日期",et_7_Registered.getText().toString());if ((rb_1_Registered.isChecked()||rb_2_Registered.isChecked())&&!name.isEmpty()&&!phonenumber.isEmpty()){Intent intent = new Intent(Registered.this, Successful_Registration.class);startActivity(intent);}else{Toast.makeText(Registered.this,"带*项为必填项",Toast.LENGTH_SHORT).show();}}else {Toast.makeText(Registered.this,"请勾选协议",Toast.LENGTH_SHORT).show();}}});}
}
我将新用户注册界面的带*项设置为必填项,如果不需要设为必填项就将if((rb_1_Registered.isChecked()||rb_2_Registered.isChecked())&&!name.isEmpty()&&!phonenumber.isEmpty())这个if语句去掉,直接写跳转语句就行了
因为没有连接数据库,所以编辑框的内容无法保存,我直接用了Log显现出来了。
三、忘记密码界面
<TextViewandroid:layout_width="match_parent"android:layout_height="50dp"android:text="忘记密码界面"android:textSize="40dp"android:gravity="center"android:background="#90CFEC"/><RadioGroupandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="vertical"android:layout_marginTop="100dp"android:layout_gravity="center"><RadioButtonandroid:id="@+id/rb_1_Password"android:layout_width="match_parent"android:layout_height="30dp"android:text="邮箱验证"android:textSize="25dp"android:layout_marginTop="10dp"android:background="@drawable/cb_2_solid"/><RadioButtonandroid:id="@+id/rb_2_Password"android:layout_width="match_parent"android:layout_height="30dp"android:text="手机验证"android:textSize="25dp"android:layout_marginTop="30dp"android:background="@drawable/cb_2_solid"/><RadioButtonandroid:id="@+id/rb_3_Password"android:layout_width="match_parent"android:layout_height="30dp"android:text="密保验证"android:textSize="25dp"android:layout_marginTop="30dp"android:background="@drawable/cb_2_solid"/></RadioGroup><Buttonandroid:id="@+id/bt_1_Password"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="确认"android:textSize="40dp"android:layout_marginLeft="160dp"android:layout_marginTop="40dp"android:background="@drawable/bt_1_solid_blue"/>
public class Forgot_Password extends AppCompatActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_forgot_password);RadioButton rb_1_Password=findViewById(R.id.rb_1_Password);//邮箱验证单选按钮RadioButton rb_2_Password=findViewById(R.id.rb_2_Password);//短信验证单选按钮RadioButton rb_3_Password=findViewById(R.id.rb_3_Password);//密保问题验证单选按钮Button bt_1=findViewById(R.id.bt_1_Password);bt_1.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View view) {if (rb_1_Password.isChecked()){Intent intent = new Intent(Forgot_Password.this, Email_Verification.class);startActivity(intent);}else if (rb_2_Password.isChecked()){Intent intent = new Intent(Forgot_Password.this, Message_Verification.class);startActivity(intent);}else if (rb_3_Password.isChecked()){Intent intent = new Intent(Forgot_Password.this, Secret_Verification.class);startActivity(intent);}}});}
}
按钮我用的是Radiobutton单选按钮,因为用到了三个单选按钮,我又用到了RadioGroup来装单选按钮,RadioGroup组的用法就是,里面的单选按钮只能有一个按钮别选中,如果没有用RadioGroup组的话,可以理解为一个单独的RadioButton就是一个RadioGroup,那么三个RadioButton就是三个RadioGroup,那就是三个RadioButton又可以同时选中。
四、用户信息界面
<TextViewandroid:layout_width="match_parent"android:layout_height="40dp"android:text="用户信息界面"android:textSize="35dp"android:gravity="center"android:background="#8DCEEC"/><RelativeLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_gravity="center"android:layout_marginLeft="30dp"android:layout_marginTop="40dp"><ImageViewandroid:id="@+id/iv_1_user"android:layout_width="100dp"android:layout_height="100dp"android:layout_marginLeft="90dp"android:scaleType="centerInside"android:src="@drawable/head_photo" /><TextViewandroid:id="@+id/tv_1_user"android:layout_width="wrap_content"android:layout_height="30dp"android:text="用 户 名:"android:textSize="20dp"android:layout_marginLeft="50dp"android:layout_below="@id/iv_1_user"android:layout_marginTop="20dp"/><TextViewandroid:id="@+id/tv_2_user"android:layout_width="wrap_content"android:layout_height="30dp"android:layout_marginLeft="20dp"android:layout_toRightOf="@id/tv_1_user"android:text="张三"android:textSize="20dp"android:layout_below="@id/iv_1_user"android:layout_marginTop="20dp"/><TextViewandroid:id="@+id/tv_15_user"android:layout_width="wrap_content"android:layout_height="30dp"android:layout_below="@id/tv_1_user"android:layout_marginTop="10dp"android:text="性 别:"android:textSize="20dp"android:layout_marginLeft="50dp"/><TextViewandroid:id="@+id/tv_16_user"android:layout_width="wrap_content"android:layout_height="30dp"android:layout_below="@id/tv_2_user"android:layout_marginLeft="20dp"android:layout_marginTop="10dp"android:layout_toRightOf="@id/tv_15_user"android:text="男"android:textSize="20dp"/><TextViewandroid:id="@+id/tv_3_user"android:layout_width="wrap_content"android:layout_height="30dp"android:layout_below="@id/tv_13_user"android:layout_marginTop="10dp"android:text="个性签名:"android:textSize="20dp"android:layout_marginLeft="50dp"/><TextViewandroid:id="@+id/tv_4_user"android:layout_width="wrap_content"android:layout_height="30dp"android:layout_below="@id/tv_14_user"android:layout_marginLeft="20dp"android:layout_marginTop="10dp"android:layout_toRightOf="@id/tv_3_user"android:text="憨批"android:textSize="20dp" /><TextViewandroid:id="@+id/tv_5_user"android:layout_width="wrap_content"android:layout_height="30dp"android:layout_below="@id/tv_15_user"android:layout_marginTop="10dp"android:text="星 座:"android:textSize="20dp"android:layout_marginLeft="50dp"/><TextViewandroid:id="@+id/tv_6_user"android:layout_width="wrap_content"android:layout_height="30dp"android:layout_below="@id/tv_16_user"android:layout_marginLeft="20dp"android:layout_marginTop="10dp"android:layout_toRightOf="@id/tv_3_user"android:text="射手座"android:textSize="20dp"/><TextViewandroid:id="@+id/tv_7_user"android:layout_width="wrap_content"android:layout_height="30dp"android:layout_below="@id/tv_5_user"android:layout_marginTop="10dp"android:text="爱 好:"android:textSize="20dp"android:layout_marginLeft="50dp"/><TextViewandroid:id="@+id/tv_8_user"android:layout_width="wrap_content"android:layout_height="30dp"android:layout_below="@id/tv_6_user"android:layout_marginLeft="20dp"android:layout_marginTop="10dp"android:layout_toRightOf="@id/tv_7_user"android:text="吃饭睡觉打豆豆"android:textSize="20dp"/><TextViewandroid:id="@+id/tv_9_user"android:layout_width="wrap_content"android:layout_height="30dp"android:layout_below="@id/tv_11_user"android:layout_marginTop="10dp"android:text="绑定手机:"android:textSize="20dp"android:layout_marginLeft="50dp"/><TextViewandroid:id="@+id/tv_10_user"android:layout_width="wrap_content"android:layout_height="30dp"android:layout_below="@id/tv_12_user"android:layout_marginLeft="20dp"android:layout_marginTop="10dp"android:layout_toRightOf="@id/tv_9_user"android:text="17758779139"android:textSize="20dp"/><TextViewandroid:id="@+id/tv_11_user"android:layout_width="wrap_content"android:layout_height="30dp"android:layout_below="@id/tv_7_user"android:layout_marginTop="10dp"android:text="生 日:"android:textSize="20dp"android:layout_marginLeft="50dp"/><TextViewandroid:id="@+id/tv_12_user"android:layout_width="wrap_content"android:layout_height="30dp"android:layout_below="@id/tv_8_user"android:layout_marginLeft="20dp"android:layout_marginTop="10dp"android:layout_toRightOf="@id/tv_11_user"android:text="11-10"android:textSize="20dp"/><TextViewandroid:id="@+id/tv_13_user"android:layout_width="wrap_content"android:layout_height="30dp"android:layout_below="@id/tv_9_user"android:layout_marginTop="10dp"android:text="所在城市:"android:textSize="20dp"android:layout_marginLeft="50dp"/><TextViewandroid:id="@+id/tv_14_user"android:layout_width="wrap_content"android:layout_height="30dp"android:layout_below="@id/tv_10_user"android:layout_marginLeft="20dp"android:layout_marginTop="10dp"android:layout_toRightOf="@id/tv_13_user"android:text="江西 萍乡"android:textSize="20dp"/><Buttonandroid:id="@+id/bt_1_user"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_below="@id/tv_4_user"android:layout_marginLeft="20dp"android:layout_marginTop="20dp"android:background="@drawable/bt_5_solid_blue"android:text="编辑个人信息" /><Buttonandroid:id="@+id/bt_2_user"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_below="@id/tv_4_user"android:layout_marginLeft="15dp"android:layout_marginTop="20dp"android:layout_toRightOf="@id/bt_3_user"android:background="@drawable/bt_5_solid_blue"android:text="签到"android:textSize="20dp" /><Buttonandroid:id="@+id/bt_3_user"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_below="@id/tv_4_user"android:layout_marginLeft="15dp"android:layout_marginTop="20dp"android:layout_toRightOf="@id/bt_1_user"android:background="@drawable/bt_5_solid_blue"android:text="日期查询"android:textSize="20dp"/></RelativeLayout>
protected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_user_screen);Button bt_1_user=findViewById(R.id.bt_1_user);bt_1_user.setOnClickListener(new View.OnClickListener() {//修改个人信息按钮监听@Overridepublic void onClick(View view) {Intent intent = new Intent(User_Screen.this, Renew_Message.class);startActivity(intent);}});Button bt_2_user=findViewById(R.id.bt_2_user);bt_2_user.setOnClickListener(new View.OnClickListener() {//签到按钮监听@Overridepublic void onClick(View view) {Intent intent = new Intent(User_Screen.this, Sig_in.class);startActivity(intent);}});Intent intent=getIntent();TextView textView=findViewById(R.id.tv_4_user);textView.setText(intent.getStringExtra("Extra_message"));Button bt_3_user=findViewById(R.id.bt_3_user);bt_3_user.setOnClickListener(new View.OnClickListener() {//查询时间按钮监听@Overridepublic void onClick(View view) {Intent intent1 = new Intent(User_Screen.this, Data_find.class);startActivity(intent1);}});}
}
个人信息界面和注册界面十分相似,就是将文本显现出来就ok了,我还额外写了一个修改用户信息按钮和查询日期按钮,因为还是没有连接数据库我就不呈现了
五、课程签到界面
<RelativeLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"><TextViewandroid:id="@+id/tv_5_sign"android:layout_width="match_parent"android:layout_height="40dp"android:gravity="center"android:text="物联网201签到界面"android:textColor="#99000000"android:textSize="35dp" /><TextViewandroid:id="@+id/tv_1_sign"android:layout_width="60dp"android:layout_height="40dp"android:layout_marginLeft="30dp"android:text="课程:"android:textSize="25dp"android:layout_below="@id/tv_5_sign"android:layout_marginTop="40dp"/><Spinnerandroid:id="@+id/sp_1_sign"android:layout_width="180dp"android:layout_height="40dp"android:layout_below="@id/tv_5_sign"android:layout_marginTop="40dp"android:layout_toRightOf="@id/tv_1_sign"android:gravity="center"android:popupBackground="@drawable/sp_1_solid"android:scrollbarSize="30dp" /><TextViewandroid:id="@+id/tv_2_sign"android:layout_width="60dp"android:layout_height="40dp"android:layout_below="@id/tv_1_sign"android:layout_marginLeft="30dp"android:layout_marginTop="5dp"android:text="课时:"android:textSize="25dp"/><Spinnerandroid:id="@+id/sp_2_sign"android:layout_width="180dp"android:layout_height="40dp"android:layout_below="@id/sp_1_sign"android:layout_toRightOf="@id/tv_2_sign"android:popupBackground="@drawable/sp_1_solid"android:gravity="center"android:scrollbarSize="30dp" /><TextViewandroid:id="@+id/tv_4_sign"android:layout_width="60dp"android:layout_height="40dp"android:text="日期:"android:textSize="25dp"android:layout_below="@id/tv_2_sign"android:layout_marginLeft="30dp"android:layout_marginTop="5dp"/><TextViewandroid:id="@+id/tv_3_sign"android:layout_width="150dp"android:layout_height="40dp"android:textSize="25dp"android:layout_below="@id/tv_2_sign"android:layout_toRightOf="@id/tv_4_sign"android:layout_marginTop="5dp"/><ImageViewandroid:layout_width="90dp"android:layout_height="100dp"android:layout_marginLeft="280dp"android:layout_marginTop="60dp"android:src="@drawable/smile"tools:visibility="visible" /><LinearLayoutandroid:id="@+id/L_1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_below="@id/tv_4_sign"android:orientation="horizontal"><TextViewandroid:layout_width="wrap_content"android:layout_height="40dp"android:text="距毕业还有"android:textSize="25dp"android:layout_marginLeft="30dp"/><TextViewandroid:id="@+id/tv_6_sign"android:layout_width="wrap_content"android:layout_height="50dp"android:text=" 99 "android:textSize="33dp"android:textColor="#FF0000"/><TextViewandroid:layout_width="wrap_content"android:layout_height="40dp"android:text="天"android:textSize="25dp"/></LinearLayout><TextViewandroid:layout_width="match_parent"android:layout_height="40dp"android:layout_below="@id/L_1"android:gravity="center"android:text="拼一个春夏秋冬,换一生无怨无悔"android:textSize="25dp"android:layout_marginTop="10dp"/></RelativeLayout><Buttonandroid:id="@+id/bt_1_sig"android:layout_width="200dp"android:layout_height="200dp"android:layout_marginTop="80dp"android:layout_marginLeft="100dp"android:background="@drawable/bt_6_solid_round_blue"android:text="签到"android:textSize="80dp"android:textColor="#117380"/>
protected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_sign_in);Spinner sp_1_sign=findViewById(R.id.sp_1_sign);Spinner sp_2_sign=findViewById(R.id.sp_2_sign);String []subject={"未选","Java物联网程序设计","C语言设计","无线组网技术","大学生体育","UI移动设计"};String []time={"未选","1-2节","3-4节","课外一","5-6节","7-8节","课外二"};ArrayAdapter arrayAdapter1=new ArrayAdapter(this, android.R.layout.simple_spinner_item,subject);sp_1_sign.setAdapter(arrayAdapter1);ArrayAdapter arrayAdapter2 = new ArrayAdapter(this, android.R.layout.simple_spinner_item, time);sp_2_sign.setAdapter(arrayAdapter2);Date date = new Date();SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd");TextView textView=findViewById(R.id.tv_3_sign);textView.setText(dateFormat.format(date));Button bt_1_sig=findViewById(R.id.bt_1_sig);sp_1_sign.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {@Overridepublic void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {String subject = adapterView.getItemAtPosition(i).toString();Log.e("课程",subject);bt_1_sig.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View view) {if (subject.equals("未选")){Toast.makeText(Sig_in.this,"未选择课程",Toast.LENGTH_SHORT).show();}else{sp_2_sign.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {@Overridepublic void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {String time = adapterView.getItemAtPosition(i).toString();Log.e("课时",time);if (time.equals("未选")){Toast.makeText(Sig_in.this,"未选择课时",Toast.LENGTH_SHORT).show();}else {bt_1_sig.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View view) {Intent intent = new Intent(Sig_in.this,Successful_Sig_In.class);startActivity(intent);}});}}@Overridepublic void onNothingSelected(AdapterView<?> adapterView) {}});}}});}@Overridepublic void onNothingSelected(AdapterView<?> adapterView) {}});TextView tv_6_sign=findViewById(R.id.tv_6_sign);tv_6_sign.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);}
课程和课时我用的Spinner控件(它的作用也和单选按钮类似),就是一个简单的下拉框,我们可以自定义设置里面的内容,他的用法就是给Spinner控件添加一个适配器,然后再设置一个监听,就可以知道用户选的是下拉框里哪一项内容了。
Android Studio 学生课程签到系统相关推荐
- 基于Android studio学生考勤签到系统app
功能详细介绍 客户端 签到:用户再登录软件后,可以点击签到,进行在线签到,以记录当天的考勤信息. 请假:用户点击请假后,可以在线申请请假,等待教师的查看审核. 我的班级:可以查看个人的班级信息,并能通 ...
- IDEA+Java+Servlet+JSP+Mysql实现学生选课签到系统
一.系统介绍 1.开发环境 开发工具:IDEA2018 JDK版本:jdk1.8 Mysql版本:8.0.13 2.技术选型 Java+Servlet+Boostrap+Jsp+Mysql 3.系统功 ...
- 学生上课签到系统开发总结
由于期末作业要交个作品,正好这学期学了ssh企业及应用开发,所以就用ssh做了个最简单的签到系统,从最基本的整合开始,经历了各种坑,直到项目完成,花了一周的时间.基本上每天都在敲代码,一个人一周完成一 ...
- 日历 android 周历,Android Studio 基础 之 获取系统Calendar 日历日程 (涉及指定日期时间判断是星期几的方法使用)的方法整理...
Android Studio 基础 之 获取系统Calendar 日历日程 (涉及指定日期时间判断是星期几的方法使用)的方法整理 目录 Android Studio 基础 之 获取系统Calendar ...
- [附源码]计算机毕业设计Python+uniapp基于Android的学生评教系统rfl6a(程序+源码+LW+远程部署)
[附源码]计算机毕业设计Python+uniapp基于Android的学生评教系统rfl6a(程序+源码+LW+远程部署) 该项目含有源码.文档.程序.数据库.配套开发软件.软件安装教程 项目运行环境 ...
- Android Studio 基础 之 获取系统Calendar 日历日程(可获得当天以后可设定天数范围内的日历日程) (涉及指定日期时间判断是星期几的方法使用)的方法整理
Android Studio 基础 之 获取系统Calendar 日历日程(可获得当天以后可设定天数范围内的日历日程) (涉及指定日期时间判断是星期几的方法使用)的方法整理 目录 Android St ...
- javaweb实验室学生考勤签到系统
管理员信息表,包括自动编号,管理员账号,登录密码等数据字段: 电脑主机信息表,包括自动编号,分区,主机编号,ip地址等数据字段: 实验课表信息表,包括自动编号,课程,上课时间,教室,教师id等数据字段 ...
- Android Studio实现外卖订餐系统
项目目录 一.项目概述 二.使用技术 三.开发环境 四.详细设计 4.1 工程结构 4.2 数据库设计 4.3 首页 4.4 购物车 4.5 我的 4.6 滑动菜单 五.运行演示 六.项目总结 七.源 ...
- 电脑 android studio 如何连接安卓系统进行app 调试
1.windows + R 按键打开电脑cmd 终端: 2.将安卓系统连接wifi ,查看网络地址,例如:192.168.0.182 ,在电脑终端输入: adb connect 192.168.0. ...
- android studio CreateProcess error=2, 系统找不到指定的文件。
简述:做ping++支付功能,在下载运行官方demo的时候,android studio报这个错误,答案有很多,试了很多方式,没管用,直到看到一位大神:梁生zZ的操作: 1. 方法一:打开 local ...
最新文章
- html iframe 播放视频播放,播放iframe视频点击链接javascript
- Bug只让变量生效一次的思路
- SAP Spartacus org unit list点击item之后的页面跳转实现
- 欧洲最权威的12星座分析①
- android lint工作机制,Android架构
- rails 共享变量_如何将Rails实例变量传递给Vue组件
- VMware创建Linux及局域网内独立访问IP和访问外网IP的配置
- 总结计算机语言的基本元素,认识程序设计中基本元素教案.doc
- [Ext JS] 3.5 单选框 Radio与复选框CheckBox
- docker on marathonmesos示例
- Linux命令——uptime
- TF-IDF来源及理论推导 熵推导出
- Ubuntu18.04安装Pangolin0.6
- 湖南信息学院大一C语言考试,2003级信息学院《C语言程序设计》考试试题
- Java程序员,面试必读
- DevOps落地实践:BAT系列:敏捷看板:iCafe vs Tapd
- axios 登录后设置header,vue+axios 全局添加请求头和参数操作
- ProcessOn第一次使用教程
- CKP.CMP工作原理===
- C#使用EmguCV库介绍(一)
热门文章
- vs2010开发android教程,用Visual Studio 2010开发Android应用
- Android开机动画的动态替换
- Python调用海康威视网络相机之——python读取相机rtsp码流显示画面
- Altera系列板子没有办法sudo,问题解决
- 2021爱分析·药企数字化趋势报告
- Flash MX 2004 编程(AS2.0)教程(五)
- 【PHP大马】定义、下载、使用、源码
- 爆!看过这么多教程吗?不管你看没看过,我反正是没看过!
- HTML5期末大作业:5G网络网页设计——3页(代码质量好) 学生DW网页设计作业源码 web课程设计网页规划与设计
- 使用ffmpeg合并.h264文件