Android学生信息管理系统(1)登录界面设计

文章详细描述了一个Android应用中的登录界面,包括EditText输入框、CheckBox、ProgressBar和登录按钮,以及使用SharedPreferences进行密码保存的功能。同时提到了跳槽时应考虑的因素和资源利用的重要性。
摘要由CSDN通过智能技术生成

android:hint=" " />

<LinearLayout

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:orientation=“horizontal”>

<TextView

android:textColor=“@color/colorAccent”

android:id=“@+id/password”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:gravity=“end”

android:text=“请输入你的密码:”

android:textSize=“30sp”

android:textStyle=“bold” />

<EditText

android:id=“@+id/input2”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:hint=" " />

<LinearLayout

android:layout_marginTop=“60dp”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”>

<CheckBox

android:layout_height=“wrap_content”

android:id=“@+id/remember_button”

android:layout_width=“wrap_content”

android:layout_marginLeft=“50dp” />

<TextView

android:layout_marginLeft=“60dp”

android:id=“@+id/remember_text”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:textSize=“18sp”

android:text=“是否保存本次密码”

android:textStyle=“bold” />

<ProgressBar

android:layout_marginTop=“20dp”

android:id=“@+id/progress”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:max=“250” />

<Button

android:layout_marginTop=“30dp”

android:id=“@+id/login_button”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_marginLeft=“120dp”

android:layout_marginRight=“15dp”

android:background=“#add8e6”

android:text=“点击注册进入”

android:textSize=“25sp” />

package com.example.android;

import android.app.Activity;

import android.content.Intent;

import android.content.SharedPreferences;

import android.os.Bundle;

import android.preference.PreferenceManager;

import android.view.View.OnClickListener;

import android.view.View;

import android.widget.Button;

import android.widget.CheckBox;

import android.widget.EditText;

import android.widget.ProgressBar;

import android.widget.Toast;

public class MainActivity extends Activity implements OnClickListener{

Button button;

EditText edit1,edit2;

CheckBox checkbox;

ProgressBar bar;

SharedPreferences pref;

SharedPreferences.Editor editor;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

button=(Button) findViewById(R.id.login_button);

edit1=(EditText) findViewById(R.id.input1);

edit2=(EditText) findViewById(R.id.input2);

checkbox=(CheckBox) findViewById(R.id.remember_button);

bar=(ProgressBar) findViewById(R.id.progress);//进度条

pref= PreferenceManager.getDefaultSharedPreferences(this);

boolean isRemember=pref.getBoolean(“rem”,false); //用于给是否保存密码赋值

if(isRemember) {

//将账号和密码设置到文本框中

String account=pref.getString(“account”,“”);

String password=pref.getString(“password”,“”);

edit1.setText(account);

edit2.setText(password);

checkbox.setChecked(true);

}

button.setOnClickListener(this);

}

@Override

public void onClick(View v){

String account=edit1.getText().toString();

String password=edit2.getText().toString();

if(account.equals(“0417200131”) && password.equals(“123456789”)) {

editor = pref.edit();

if(checkbox.isChecked()) {

editor.putBoolean(“rem”,true);

editor.putString(“account”,account);

editor.putString(“password”,password);

}

文末

当你打算跳槽的时候,应该把“跳槽成功后,我能学到什么东西?对我的未来发展有什么好处”放在第一位。这些东西才是真正引导你的关键。在跳槽之前尽量“物尽其用”,把手头上的工作做好,最好是完成了某个项目或是得到提升之后再走。跳槽不是目的,而是为了达到最终职业目标的手段

最后祝大家工作升职加薪,面试拿到心仪Offer



《Android学习笔记总结+移动架构视频+大厂面试真题+项目实战源码》点击传送门,即可获取!
或是得到提升之后再走。跳槽不是目的,而是为了达到最终职业目标的手段**

最后祝大家工作升职加薪,面试拿到心仪Offer

[外链图片转存中…(img-4uuw3cdq-1714756994294)]
[外链图片转存中…(img-e9ZIAc9v-1714756994294)]
《Android学习笔记总结+移动架构视频+大厂面试真题+项目实战源码》点击传送门,即可获取!

  • 22
    点赞
  • 29
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值