@ -0,0 +1 @@
|
||||
/build
|
@ -0,0 +1,48 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 32
|
||||
buildToolsVersion "32.0.0" // 确保使用与编译SDK版本兼容的构建工具版本
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.myexamproject"
|
||||
minSdkVersion 22
|
||||
targetSdkVersion 32
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
viewBinding true // 启用视图绑定
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.3.0'
|
||||
implementation 'com.google.android.material:material:1.4.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
}
|
||||
|
||||
clean {
|
||||
delete 'build' // 只清理与当前构建相关的目录
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
@ -0,0 +1,26 @@
|
||||
package com.example.myexamproject;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.example.myexamproject", appContext.getPackageName());
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.myexamproject">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/tubiao"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@drawable/tubiao"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.MyExamProject">
|
||||
<activity
|
||||
android:name=".UpdateIFActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".MyIFActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".UpdateGamesActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".RegisterActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".QueryGamesActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".PersonalCenterActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".LoginActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".DeleteGamesActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".BackActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".AddGamesActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".WelcomeActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -0,0 +1,96 @@
|
||||
package com.example.myexamproject;
|
||||
|
||||
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.myexamproject.bean.Game;
|
||||
import com.example.myexamproject.utils.MySQLiteOpenHelper;
|
||||
|
||||
|
||||
public class AddGamesActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
//组件定义
|
||||
private EditText etGameid;
|
||||
private EditText etGamename;
|
||||
private EditText etGametime;
|
||||
private EditText etGamenote;
|
||||
|
||||
private Button btnAdd;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_add_games);
|
||||
//初始化界面
|
||||
initView();
|
||||
}
|
||||
|
||||
//初始化界面
|
||||
private void initView() {
|
||||
etGameid=(EditText)findViewById(R.id.et_gameid);
|
||||
etGamename = (EditText) findViewById(R.id.et_gamename);
|
||||
etGametime = (EditText) findViewById(R.id.et_gametime);
|
||||
etGamenote = (EditText) findViewById(R.id.et_gamenote);
|
||||
|
||||
btnAdd = (Button) findViewById(R.id.btn_add);
|
||||
//设置按钮的点击事件
|
||||
btnAdd.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
//当单击“添加”按钮时,获取添加信息
|
||||
String gameid=etGameid.getText().toString().trim();
|
||||
String gamename = etGamename.getText().toString().trim();
|
||||
String gametime = etGametime.getText().toString().trim();
|
||||
String gamenote = etGamenote.getText().toString();
|
||||
|
||||
|
||||
//检验信息是否正确
|
||||
if (TextUtils.isEmpty(gameid)) {
|
||||
Toast.makeText(this, "请输入活动id", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (TextUtils.isEmpty(gamename)) {
|
||||
Toast.makeText(this, "请输入活动名称", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (TextUtils.isEmpty(gametime)) {
|
||||
Toast.makeText(this, "请输入活动时间", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (TextUtils.isEmpty(gamenote)) {
|
||||
Toast.makeText(this, "请输入备注", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
//添加信息
|
||||
Game game =new Game();
|
||||
game.gameid= gameid;
|
||||
game.gamename = gamename;
|
||||
game.gametime = gametime;
|
||||
game.gamenote= gamenote;
|
||||
|
||||
//创建数据库访问对象
|
||||
MySQLiteOpenHelper dao = new MySQLiteOpenHelper(getApplicationContext());
|
||||
dao.open();
|
||||
long result = dao.addGames(game);
|
||||
|
||||
if (result > 0) {
|
||||
Toast.makeText(this, "发布成功", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(this, "发布失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
dao.close();
|
||||
finish();
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.example.myexamproject;
|
||||
|
||||
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
public class BackActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
|
||||
private Button bt_backfalse;
|
||||
private Button bt_backtrue;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_back);
|
||||
|
||||
bt_backfalse = findViewById(R.id.bt_backfalse);
|
||||
bt_backfalse.setOnClickListener(this);
|
||||
|
||||
bt_backtrue = findViewById(R.id.bt_backtrue);
|
||||
bt_backtrue.setOnClickListener(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
case R.id.bt_backfalse:
|
||||
Intent intent_insert = new Intent();
|
||||
intent_insert.setClass(BackActivity.this, PersonalCenterActivity.class);
|
||||
startActivity(intent_insert);
|
||||
break;
|
||||
|
||||
case R.id.bt_backtrue:
|
||||
Intent intent_query = new Intent();
|
||||
intent_query.setClass(BackActivity.this, LoginActivity.class);
|
||||
startActivity(intent_query);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package com.example.myexamproject;
|
||||
|
||||
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.myexamproject.bean.Game;
|
||||
import com.example.myexamproject.utils.MySQLiteOpenHelper;
|
||||
|
||||
|
||||
public class DeleteGamesActivity extends AppCompatActivity implements View.OnClickListener{
|
||||
|
||||
|
||||
private EditText etGameid;
|
||||
private Button btnSearch;
|
||||
private EditText etGamename;
|
||||
private EditText etGametime;
|
||||
private EditText etGamenote;
|
||||
private Button btnDelete;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_delete_games);
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
etGameid=(EditText) findViewById(R.id.et_gameid);
|
||||
btnSearch=(Button) findViewById(R.id.btn_search);
|
||||
etGamename=(EditText)findViewById(R.id.et_gamename);
|
||||
etGametime=(EditText)findViewById(R.id.et_gametime);
|
||||
etGamenote=(EditText)findViewById(R.id.et_gamenote);
|
||||
btnDelete= (Button) findViewById(R.id.btn_delete);
|
||||
|
||||
|
||||
btnSearch.setOnClickListener((View.OnClickListener) this);
|
||||
btnDelete.setOnClickListener((View.OnClickListener) this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
switch(v.getId())
|
||||
{
|
||||
case R.id.btn_search:
|
||||
searchOrder();
|
||||
break;
|
||||
case R.id.btn_delete:
|
||||
deleteOrder();
|
||||
break;
|
||||
}
|
||||
}
|
||||
//查找借书信息
|
||||
private void searchOrder() {
|
||||
String studentid=etGameid.getText().toString().trim();
|
||||
MySQLiteOpenHelper dao=new MySQLiteOpenHelper(getApplicationContext());
|
||||
dao.open();
|
||||
Game game=dao.getGames(studentid);
|
||||
etGamename.setText(game.gamename);
|
||||
etGametime.setText(game.gametime);
|
||||
etGamenote.setText(game.gamenote);
|
||||
|
||||
dao.close();
|
||||
}
|
||||
private void deleteOrder() {
|
||||
Game game=new Game();
|
||||
game.gameid=etGameid.getText().toString().trim();
|
||||
MySQLiteOpenHelper dao=new MySQLiteOpenHelper(getApplicationContext());
|
||||
dao.open();
|
||||
int result= dao.deletGames(game);
|
||||
if(result>0) {
|
||||
Toast.makeText(this, "删除成功", Toast.LENGTH_SHORT).show();
|
||||
}else{
|
||||
Toast.makeText(this, "删除失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
dao.close();
|
||||
}
|
||||
}
|
@ -0,0 +1,157 @@
|
||||
package com.example.myexamproject;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.myexamproject.utils.MD5Utils;
|
||||
|
||||
public class LoginActivity extends AppCompatActivity {
|
||||
private EditText et_username;
|
||||
private EditText et_pwd;
|
||||
private CheckBox save_pwd;
|
||||
private String userName, passWord, spPsw;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_login);
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
et_username = findViewById(R.id.username);
|
||||
et_pwd = findViewById(R.id.pwd);
|
||||
save_pwd = findViewById(R.id.save_pwd);
|
||||
|
||||
// 获取记住的账号密码
|
||||
getUserInfo();
|
||||
|
||||
// 登录方法
|
||||
Button login = findViewById(R.id.loginBtn);
|
||||
login.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
getEditString();
|
||||
String md5Psw = MD5Utils.md5(passWord);
|
||||
spPsw = readPsw(userName);
|
||||
|
||||
if (TextUtils.isEmpty(userName)) {
|
||||
Toast.makeText(LoginActivity.this, "请输入用户名", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else if (TextUtils.isEmpty(passWord)) {
|
||||
Toast.makeText(LoginActivity.this, "请输入密码", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else if (md5Psw.equals(spPsw)) {
|
||||
// 一致登录成功
|
||||
Toast.makeText(LoginActivity.this, "欢迎!" + userName, Toast.LENGTH_SHORT).show();
|
||||
// 保存登录状态,在界面保存登录的用户名和密码
|
||||
saveLoginInfo(userName, passWord);
|
||||
saveLoginStatus(true, userName);
|
||||
// 登录成功后关闭此页面进入主页
|
||||
Intent data = new Intent();
|
||||
data.putExtra("isLogin", true);
|
||||
setResult(RESULT_OK, data);
|
||||
LoginActivity.this.finish();
|
||||
// 跳转到下一个界面
|
||||
startActivity(new Intent(LoginActivity.this, MainActivity.class));
|
||||
return;
|
||||
} else {
|
||||
Toast.makeText(LoginActivity.this, "用户名或密码错误", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
TextView tv_register = findViewById(R.id.register);
|
||||
tv_register.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// 跳转到注册界面
|
||||
Intent intent = new Intent(LoginActivity.this, RegisterActivity.class);
|
||||
startActivity(intent);
|
||||
LoginActivity.this.finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 获取用户名和密码
|
||||
private void getEditString() {
|
||||
userName = et_username.getText().toString().trim();
|
||||
passWord = et_pwd.getText().toString().trim();
|
||||
}
|
||||
|
||||
// 保存登录信息
|
||||
private void saveLoginInfo(String userName, String passWord) {
|
||||
boolean CheckBoxLogin = save_pwd.isChecked();
|
||||
SharedPreferences sp = getSharedPreferences("userInfo", MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sp.edit();
|
||||
// 设置参数
|
||||
if (CheckBoxLogin) {
|
||||
editor.putString("username", userName);
|
||||
editor.putString("password", passWord);
|
||||
editor.putBoolean("checkboxBoolean", true);
|
||||
editor.commit();
|
||||
} else {
|
||||
editor.putString("username", null);
|
||||
editor.putString("password", null);
|
||||
editor.putBoolean("checkboxBoolean", false);
|
||||
editor.commit();
|
||||
}
|
||||
}
|
||||
|
||||
// 从已经存入的对象中读取密码
|
||||
private String readPsw(String userName) {
|
||||
SharedPreferences sp = getSharedPreferences("loginInfo", MODE_PRIVATE);
|
||||
return sp.getString(userName, "");
|
||||
}
|
||||
|
||||
// 保存登录状态
|
||||
private void saveLoginStatus(boolean status, String userName) {
|
||||
SharedPreferences sp = getSharedPreferences("loginInfo", MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sp.edit();
|
||||
editor.putBoolean("isLogin", status);
|
||||
editor.putString("loginUserName", userName);
|
||||
editor.commit();
|
||||
}
|
||||
|
||||
// 返回注册成功数据
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (data != null) {
|
||||
String userName = data.getStringExtra("userName");
|
||||
if (!TextUtils.isEmpty(userName)) {
|
||||
et_username.setText(userName);
|
||||
et_username.setSelection(userName.length());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获得用户已注册的信息
|
||||
private void getUserInfo() {
|
||||
SharedPreferences sp = this.getSharedPreferences("userInfo", Context.MODE_PRIVATE);
|
||||
if (sp.getBoolean("checkboxBoolean", false)) {
|
||||
et_username.setText(sp.getString("username", null));
|
||||
et_pwd.setText(sp.getString("password", null));
|
||||
save_pwd.setChecked(true);
|
||||
} else {
|
||||
et_username.setText(sp.getString("username", userName));
|
||||
et_pwd.setText(sp.getString("password", passWord));
|
||||
save_pwd.setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
LoginActivity.this.finish();
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.example.myexamproject;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
private Button bt_updatee;
|
||||
private Button bt_deletee;
|
||||
private Button bt_read;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
// 获取按钮实例
|
||||
bt_updatee = findViewById(R.id.bt_updatee);
|
||||
bt_deletee = findViewById(R.id.bt_deletee);
|
||||
bt_read = findViewById(R.id.bt_read);
|
||||
|
||||
// 设置按钮的点击监听器
|
||||
bt_updatee.setOnClickListener(this);
|
||||
bt_deletee.setOnClickListener(this);
|
||||
bt_read.setOnClickListener(this);
|
||||
|
||||
// 获取个人中心按钮实例
|
||||
ImageButton IbPersonalCenter = findViewById(R.id.bt_personal);
|
||||
IbPersonalCenter.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(MainActivity.this, PersonalCenterActivity.class));
|
||||
}
|
||||
});
|
||||
|
||||
// 获取添加按钮实例
|
||||
ImageButton IbAdd = findViewById(R.id.bt_add);
|
||||
IbAdd.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(MainActivity.this, AddGamesActivity.class));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// 通过switch方法跳转到相应界面
|
||||
switch (v.getId()) {
|
||||
case R.id.bt_updatee:
|
||||
startActivity(new Intent(MainActivity.this, UpdateGamesActivity.class));
|
||||
break;
|
||||
case R.id.bt_deletee:
|
||||
startActivity(new Intent(MainActivity.this, DeleteGamesActivity.class));
|
||||
break;
|
||||
case R.id.bt_read:
|
||||
startActivity(new Intent(MainActivity.this, QueryGamesActivity.class));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.example.myexamproject;
|
||||
|
||||
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.example.myexamproject.bean.Student;
|
||||
import com.example.myexamproject.utils.StudentDbHelper;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
|
||||
/**
|
||||
* 我的个人信息活动类
|
||||
*/
|
||||
public class MyIFActivity extends AppCompatActivity {
|
||||
|
||||
TextView tvStuName,tvStuMajor,tvStuPhone,tvStuQq,tvStuAddress;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_my_ifactivity);
|
||||
Button btnBack = findViewById(R.id.btn_back);
|
||||
//返回点击事件,销毁当前界面
|
||||
btnBack.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
final TextView tvUserNumber = findViewById(R.id.tv_stu_number);
|
||||
tvUserNumber.setText(this.getIntent().getStringExtra("stu_number1"));
|
||||
tvStuName = findViewById(R.id.tv_stu_name);
|
||||
tvStuMajor = findViewById(R.id.tv_stu_major);
|
||||
tvStuPhone = findViewById(R.id.tv_stu_phone);
|
||||
tvStuQq = findViewById(R.id.tv_stu_qq);
|
||||
tvStuAddress = findViewById(R.id.tv_stu_address);
|
||||
StudentDbHelper dbHelper = new StudentDbHelper(getApplicationContext(),StudentDbHelper.DB_NAME,null,1);
|
||||
LinkedList<Student> students = dbHelper.readStudents(tvUserNumber.getText().toString());
|
||||
if(students != null) {
|
||||
for(Student student : students) {
|
||||
tvStuName.setText(student.getStuName());
|
||||
tvStuMajor.setText(student.getStuMajor());
|
||||
tvStuPhone.setText(student.getStuPhone());
|
||||
tvStuQq.setText(student.getStuQq());
|
||||
tvStuAddress.setText(student.getStuAddress());
|
||||
}
|
||||
}else {
|
||||
tvStuName.setText("暂未填写");
|
||||
tvStuMajor.setText("暂未填写");
|
||||
tvStuPhone.setText("暂未填写");
|
||||
tvStuQq.setText("暂未填写");
|
||||
tvStuAddress.setText("暂未填写");
|
||||
}
|
||||
Button btnModifyInfo = findViewById(R.id.btn_modify_info);
|
||||
//跳转到修改用户信息界面
|
||||
btnModifyInfo.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(getApplicationContext(),UpdateIFActivity.class);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("stu_number2",tvUserNumber.getText().toString());
|
||||
intent.putExtras(bundle);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.example.myexamproject;
|
||||
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class PersonalCenterActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
|
||||
TextView TvStuNumber;
|
||||
private Button btn_logout;
|
||||
|
||||
@Override
|
||||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_personal_center);
|
||||
btn_logout = findViewById(R.id.btn_logout);
|
||||
btn_logout.setOnClickListener(this);
|
||||
//取出登录时的登录名
|
||||
TvStuNumber = findViewById(R.id.tv_student_number);
|
||||
String StuNumber = this.getIntent().getStringExtra("username1");
|
||||
TvStuNumber.setText(StuNumber);
|
||||
//返回主界面
|
||||
Button btnBack = findViewById(R.id.bt_back);
|
||||
btnBack.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
//点击个人信息按钮
|
||||
Button btnUserInfo = findViewById(R.id.btn_user_info);
|
||||
btnUserInfo.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(getApplicationContext(),MyIFActivity.class);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("stu_number1",TvStuNumber.getText().toString());
|
||||
intent.putExtras(bundle);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
case R.id.btn_logout:
|
||||
Intent intent_insert = new Intent();
|
||||
intent_insert.setClass(PersonalCenterActivity.this, BackActivity.class);
|
||||
startActivity(intent_insert);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.example.myexamproject;
|
||||
|
||||
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import android.widget.ListView;
|
||||
import android.widget.SimpleAdapter;
|
||||
|
||||
import com.example.myexamproject.utils.MySQLiteOpenHelper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class QueryGamesActivity extends AppCompatActivity {
|
||||
//定义组件
|
||||
ListView listView=null;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_query_games);
|
||||
setTitle("查看记录");
|
||||
//初始化界面
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
MySQLiteOpenHelper dao=new MySQLiteOpenHelper(getApplicationContext());
|
||||
dao.open();
|
||||
List<Map<String,Object>> mOrderData=dao.getAllGames();
|
||||
listView=(ListView)findViewById(R.id.lst_orders);
|
||||
String[] from={"gameid","gamename","gametime","gamenote"};
|
||||
int[] to={R.id.tv_lst_gameid,R.id.tv_lst_gamename,R.id.tv_lst_gametime,R.id.tv_lst_gamenote};
|
||||
SimpleAdapter listItemAdapter=new SimpleAdapter(QueryGamesActivity.this,mOrderData,R.layout.item_list,from,to);
|
||||
listView.setAdapter(listItemAdapter);
|
||||
dao.close();
|
||||
}
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package com.example.myexamproject;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.myexamproject.utils.MD5Utils;
|
||||
|
||||
|
||||
public class RegisterActivity extends AppCompatActivity {
|
||||
//声明所有按钮
|
||||
private EditText et_username,et_pwd,et_pwd_sure;
|
||||
private Button register;
|
||||
private String userName,passWord,passWord_sure;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_register);
|
||||
init();
|
||||
}
|
||||
public void init(){
|
||||
//给按钮匹配id
|
||||
et_username = (EditText)findViewById(R.id.username);
|
||||
et_pwd = (EditText)findViewById(R.id.pwd);
|
||||
et_pwd_sure = (EditText)findViewById(R.id.pwd2);
|
||||
register = (Button)findViewById(R.id.registerBtn);
|
||||
register.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
getEditString();
|
||||
//提示输入信息
|
||||
if(TextUtils.isEmpty(userName)){
|
||||
Toast.makeText(RegisterActivity.this, "请输入用户名", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}else if(TextUtils.isEmpty(passWord)){
|
||||
Toast.makeText(RegisterActivity.this, "请输入密码", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}else if(TextUtils.isEmpty(passWord_sure)){
|
||||
Toast.makeText(RegisterActivity.this, "请再次输入密码", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}else if(!passWord.equals(passWord_sure)){
|
||||
Toast.makeText(RegisterActivity.this, "输入两次的密码不一样", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
//判断用户名是否已被注册
|
||||
}else if(isExistUserName(userName)){
|
||||
Toast.makeText(RegisterActivity.this, "此账户名已经存在", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}else{
|
||||
Toast.makeText(RegisterActivity.this, "注册成功", Toast.LENGTH_SHORT).show();
|
||||
//把保存账号密码
|
||||
saveRegisterInfo(userName, passWord);
|
||||
Intent data = new Intent();
|
||||
data.putExtra("userName", userName);
|
||||
setResult(RESULT_OK, data);
|
||||
//跳转到登录界面中
|
||||
Intent intent = new Intent(RegisterActivity.this,LoginActivity.class);
|
||||
startActivity(intent);
|
||||
RegisterActivity.this.finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//获得已输入信息
|
||||
private void getEditString(){
|
||||
userName = et_username.getText().toString().trim();
|
||||
passWord = et_pwd.getText().toString().trim();
|
||||
passWord_sure = et_pwd_sure.getText().toString().trim();
|
||||
}
|
||||
//判断输入的用户名是否已经存在
|
||||
private boolean isExistUserName(String userName){
|
||||
boolean has_userName = false;
|
||||
SharedPreferences sp = getSharedPreferences("loginInfo", MODE_PRIVATE);
|
||||
String spPsw = sp.getString(userName, "");
|
||||
//判断密码是否为空,不空则注册成功
|
||||
if(!TextUtils.isEmpty(spPsw)) {
|
||||
has_userName=true;
|
||||
}
|
||||
return has_userName;
|
||||
}
|
||||
//将用户名和密码保存到sp中
|
||||
private void saveRegisterInfo(String userName,String psw){
|
||||
String md5Psw = MD5Utils.md5(psw);//把密码用MD5加密
|
||||
SharedPreferences sp = getSharedPreferences("loginInfo", MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sp.edit();
|
||||
editor.putString(userName, md5Psw);
|
||||
editor.commit();
|
||||
}
|
||||
//跳转回登录界面
|
||||
public void onBackPressed() {
|
||||
Intent intent = new Intent();
|
||||
intent.setClass(RegisterActivity.this,LoginActivity.class);
|
||||
startActivity(intent);
|
||||
RegisterActivity.this.finish();
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package com.example.myexamproject;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.myexamproject.bean.Game;
|
||||
import com.example.myexamproject.utils.MySQLiteOpenHelper;
|
||||
|
||||
public class UpdateGamesActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
private EditText etGameid;
|
||||
private EditText etGamename;
|
||||
private EditText etGametime;
|
||||
private EditText etGamenote;
|
||||
private Button btnSearch;
|
||||
private Button btnEdit;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_update_games);
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
etGameid = findViewById(R.id.et_gameid);
|
||||
btnSearch = findViewById(R.id.btn_search);
|
||||
etGamename = findViewById(R.id.et_gamename);
|
||||
etGametime = findViewById(R.id.et_gametime);
|
||||
etGamenote = findViewById(R.id.et_gamenote);
|
||||
btnEdit = findViewById(R.id.btn_edit);
|
||||
|
||||
btnSearch.setOnClickListener(this);
|
||||
btnEdit.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.btn_search:
|
||||
searchOrder();
|
||||
break;
|
||||
case R.id.btn_edit:
|
||||
updateOrder();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void searchOrder() {
|
||||
String gameid = etGameid.getText().toString().trim();
|
||||
MySQLiteOpenHelper dao = new MySQLiteOpenHelper(getApplicationContext());
|
||||
dao.open();
|
||||
Game game = dao.getGames(gameid);
|
||||
if (game != null) {
|
||||
etGamename.setText(game.gamename);
|
||||
etGametime.setText(game.gametime);
|
||||
etGamenote.setText(game.gamenote);
|
||||
}
|
||||
dao.close();
|
||||
}
|
||||
|
||||
private void updateOrder() {
|
||||
Game game = new Game();
|
||||
game.gameid = etGameid.getText().toString().trim();
|
||||
game.gamename = etGamename.getText().toString().trim();
|
||||
game.gametime = etGametime.getText().toString().trim();
|
||||
game.gamenote = etGamenote.getText().toString().trim();
|
||||
|
||||
MySQLiteOpenHelper dao = new MySQLiteOpenHelper(getApplicationContext());
|
||||
dao.open();
|
||||
long result = dao.updateGames(game);
|
||||
if (result > 0) {
|
||||
Toast.makeText(this, "修改成功", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(this, "修改失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
dao.close();
|
||||
}
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
package com.example.myexamproject;
|
||||
|
||||
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 androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.example.myexamproject.bean.Student;
|
||||
import com.example.myexamproject.utils.StudentDbHelper;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
/**
|
||||
* 修改个人信息Activity类
|
||||
*/
|
||||
public class UpdateIFActivity extends AppCompatActivity {
|
||||
private EditText etStuName, etMajor, etPhone, etQq, etAddress;
|
||||
private TextView tvStuNumber;
|
||||
private StudentDbHelper dbHelper;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_update_ifactivity);
|
||||
tvStuNumber = findViewById(R.id.tv_stu_number);
|
||||
tvStuNumber.setText(getIntent().getStringExtra("stu_number2"));
|
||||
etStuName = findViewById(R.id.et_stu_name);
|
||||
etMajor = findViewById(R.id.et_stu_major);
|
||||
etPhone = findViewById(R.id.et_stu_phone);
|
||||
etQq = findViewById(R.id.et_stu_qq);
|
||||
etAddress = findViewById(R.id.et_stu_address);
|
||||
dbHelper = new StudentDbHelper(getApplicationContext(), StudentDbHelper.DB_NAME, null, 1);
|
||||
LinkedList<Student> students = dbHelper.readStudents(tvStuNumber.getText().toString());
|
||||
if (students != null) {
|
||||
for (Student student : students) {
|
||||
etStuName.setText(student.getStuName());
|
||||
etMajor.setText(student.getStuMajor());
|
||||
etPhone.setText(student.getStuPhone());
|
||||
etQq.setText(student.getStuQq());
|
||||
etAddress.setText(student.getStuAddress());
|
||||
}
|
||||
}
|
||||
Button btnBack = findViewById(R.id.btn_back);
|
||||
btnBack.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
Button btnSaveInfo = findViewById(R.id.btn_save_info);
|
||||
btnSaveInfo.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (CheckInput()) {
|
||||
Student student = new Student();
|
||||
student.setStuNumber(tvStuNumber.getText().toString());
|
||||
student.setStuName(etStuName.getText().toString());
|
||||
student.setStuMajor(etMajor.getText().toString());
|
||||
student.setStuPhone(etPhone.getText().toString());
|
||||
student.setStuQq(etQq.getText().toString());
|
||||
student.setStuAddress(etAddress.getText().toString());
|
||||
dbHelper.saveStudent(student);
|
||||
Toast.makeText(getApplicationContext(), "用户信息保存成功!", Toast.LENGTH_SHORT).show();
|
||||
finish(); // 销毁当前界面
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 检查输入是否为空
|
||||
private boolean CheckInput() {
|
||||
String stuName = etStuName.getText().toString().trim();
|
||||
String stuMajor = etMajor.getText().toString().trim();
|
||||
String stuPhone = etPhone.getText().toString().trim();
|
||||
String stuQq = etQq.getText().toString().trim();
|
||||
String stuAddress = etAddress.getText().toString().trim();
|
||||
if (stuName.isEmpty()) {
|
||||
Toast.makeText(this, "姓名不能为空!", Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
}
|
||||
if (stuMajor.isEmpty()) {
|
||||
Toast.makeText(this, "性别不能为空!", Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
}
|
||||
if (stuPhone.isEmpty()) {
|
||||
Toast.makeText(this, "联系方式不能为空!", Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
}
|
||||
if (stuQq.isEmpty()) {
|
||||
Toast.makeText(this, "QQ号不能为空!", Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
}
|
||||
if (stuAddress.isEmpty()) {
|
||||
Toast.makeText(this, "地址不能为空!", Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.example.myexamproject;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.Window;
|
||||
|
||||
public class WelcomeActivity extends AppCompatActivity {
|
||||
private static final int DELAY_MILLIS = 3000; // 3秒的延迟
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE); // 隐藏标题栏
|
||||
setContentView(R.layout.activity_welcome);
|
||||
|
||||
// 创建一个Handler来处理延迟跳转
|
||||
final Handler handler = new Handler();
|
||||
handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// 跳转到LoginActivity
|
||||
Intent intent = new Intent(WelcomeActivity.this, LoginActivity.class);
|
||||
startActivity(intent);
|
||||
// 关闭当前活动
|
||||
WelcomeActivity.this.finish();
|
||||
}
|
||||
}, DELAY_MILLIS);
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package com.example.myexamproject.bean;
|
||||
|
||||
public class Game {
|
||||
public String gamename;
|
||||
public String gametime;
|
||||
public String gamenote;
|
||||
public String gameid;
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.example.myexamproject.bean;
|
||||
|
||||
|
||||
public class Student {
|
||||
|
||||
private String stuNumber;
|
||||
private String stuName;
|
||||
private String stuMajor;
|
||||
private String stuPhone;
|
||||
private String stuQq;
|
||||
private String stuAddress;
|
||||
|
||||
public String getStuNumber() {
|
||||
return stuNumber;
|
||||
}
|
||||
|
||||
public void setStuNumber(String stuNumber) {
|
||||
this.stuNumber = stuNumber;
|
||||
}
|
||||
|
||||
public String getStuName() {
|
||||
return stuName;
|
||||
}
|
||||
|
||||
public void setStuName(String stuName) {
|
||||
this.stuName = stuName;
|
||||
}
|
||||
|
||||
public String getStuMajor() {
|
||||
return stuMajor;
|
||||
}
|
||||
|
||||
public void setStuMajor(String stuMajor) {
|
||||
this.stuMajor = stuMajor;
|
||||
}
|
||||
|
||||
public String getStuPhone() {
|
||||
return stuPhone;
|
||||
}
|
||||
|
||||
public void setStuPhone(String stuPhone) {
|
||||
this.stuPhone = stuPhone;
|
||||
}
|
||||
|
||||
public String getStuQq() {
|
||||
return stuQq;
|
||||
}
|
||||
|
||||
public void setStuQq(String stuQq) {
|
||||
this.stuQq = stuQq;
|
||||
}
|
||||
|
||||
public String getStuAddress() {
|
||||
return stuAddress;
|
||||
}
|
||||
|
||||
public void setStuAddress(String stuAddress) {
|
||||
this.stuAddress = stuAddress;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.example.myexamproject.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
|
||||
public class MyDBHelper extends SQLiteOpenHelper {
|
||||
//常量定义
|
||||
public static final String name = "db_game1.db";
|
||||
public static final int DB_VERSION = 1;
|
||||
//创建表
|
||||
public static final String CREATE_USERDATA1 = "create table tb_Game(gameid char(10)primary key,gamename varchar(20),gametime varchar(20),gamenote varchar(20))";
|
||||
public MyDBHelper(Context context) {
|
||||
super(context, name, null, DB_VERSION);
|
||||
}
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase db) {
|
||||
db.execSQL(CREATE_USERDATA1);
|
||||
db.execSQL("insert into tb_Game(gameid,gamename,gametime,gamenote)Values('111111','篮球赛','2024.6.1','无')");
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
}
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
package com.example.myexamproject.utils;
|
||||
|
||||
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteException;
|
||||
|
||||
|
||||
import com.example.myexamproject.bean.Game;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class MySQLiteOpenHelper {
|
||||
|
||||
private Context context;
|
||||
private MyDBHelper dbHelper;
|
||||
private SQLiteDatabase db;
|
||||
|
||||
//构造函数
|
||||
public MySQLiteOpenHelper(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
//打开数据库方法
|
||||
public void open() throws SQLiteException {
|
||||
dbHelper = new MyDBHelper(context);
|
||||
try {
|
||||
db = dbHelper.getWritableDatabase();
|
||||
} catch (SQLiteException ex) {
|
||||
db = dbHelper.getReadableDatabase();
|
||||
}
|
||||
}
|
||||
|
||||
//关闭数据库方法
|
||||
public void close() {
|
||||
if (db != null) {
|
||||
db.close();
|
||||
db = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//添加发布信息内容
|
||||
public long addGames(Game game) {
|
||||
// 创建ContentValues对象
|
||||
ContentValues values = new ContentValues();
|
||||
// 向该对象中插入值
|
||||
values.put("gameid", game.gameid);
|
||||
values.put("gamename", game.gamename);
|
||||
values.put("gametime", game.gametime);
|
||||
values.put("gamenote", game.gamenote);
|
||||
|
||||
// 通过insert()方法插入数据库中
|
||||
return db.insert("tb_Game", null, values);
|
||||
}
|
||||
|
||||
//删除发布信息
|
||||
public int deletGames(Game game) {
|
||||
return db.delete("tb_Game", "gameid=?", new String[]{String.valueOf(game.gameid)});
|
||||
}
|
||||
|
||||
//修改发布信息
|
||||
public int updateGames(Game game) {
|
||||
ContentValues value = new ContentValues();
|
||||
value.put("gamename", game.gamename);
|
||||
value.put("gametime", game.gametime);
|
||||
value.put("gamenote", game.gamenote);
|
||||
return db.update("tb_Game", value, "gameid=?", new String[]{String.valueOf(game.gameid)});
|
||||
}
|
||||
|
||||
//根据游戏id查找以发布内容
|
||||
@SuppressLint("Range")
|
||||
public Game getGames(String gameid) {
|
||||
Cursor cursor = db.query("tb_Game", null, "gameid=?", new String[]{gameid}, null, null, null);
|
||||
Game game = new Game();
|
||||
while (cursor.moveToNext()) {
|
||||
game.gameid = cursor.getString(cursor.getColumnIndex("gameid"));
|
||||
game.gamename = cursor.getString(cursor.getColumnIndex("gamename"));
|
||||
game.gametime = cursor.getString(cursor.getColumnIndex("gametime"));
|
||||
game.gamenote = cursor.getString(cursor.getColumnIndex("gamenote"));
|
||||
|
||||
}
|
||||
return game;
|
||||
}
|
||||
|
||||
//查找所有发布信息
|
||||
@SuppressLint("Range")
|
||||
public ArrayList<Map<String, Object>> getAllGames() {
|
||||
ArrayList<Map<String, Object>> listGames = new ArrayList<Map<String, Object>>();
|
||||
Cursor cursor = db.query("tb_Game", null, null, null, null, null,null);
|
||||
|
||||
int resultCounts = cursor.getCount();
|
||||
if (resultCounts == 0 ) {
|
||||
return null;
|
||||
} else {
|
||||
while (cursor.moveToNext()) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("gameid", cursor.getString(cursor.getColumnIndex("gameid")));
|
||||
map.put("gamename", cursor.getString(cursor.getColumnIndex("gamename")));
|
||||
map.put("gametime", cursor.getString(cursor.getColumnIndex("gametime")));
|
||||
map.put("gamenote", cursor.getString(cursor.getColumnIndex("gamenote")));
|
||||
|
||||
listGames.add(map);
|
||||
}
|
||||
return listGames;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package com.example.myexamproject.utils;
|
||||
|
||||
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
|
||||
|
||||
import com.example.myexamproject.bean.Student;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
|
||||
public class StudentDbHelper extends SQLiteOpenHelper {
|
||||
|
||||
//定义学生表
|
||||
public static final String DB_NAME = "tb_student";
|
||||
//创建表
|
||||
private static final String CREATE_STUDENT_DB = "create table tb_student(" +
|
||||
"id integer primary key autoincrement," +
|
||||
"stuNumber text," +
|
||||
"stuName text," +
|
||||
"stuMajor text," +
|
||||
"stuPhone text," +
|
||||
"stuQq text," +
|
||||
"stuAddress text)";
|
||||
|
||||
public StudentDbHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
|
||||
super(context, name, factory, version);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase db) {
|
||||
db.execSQL(CREATE_STUDENT_DB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
|
||||
}
|
||||
|
||||
//保存学生信息
|
||||
public void saveStudent(Student student) {
|
||||
SQLiteDatabase db = this.getWritableDatabase();
|
||||
ContentValues values = new ContentValues();
|
||||
values.put("stuNumber",student.getStuNumber());
|
||||
values.put("stuName",student.getStuName());
|
||||
values.put("stuMajor",student.getStuMajor());
|
||||
values.put("stuPhone",student.getStuPhone());
|
||||
values.put("stuQq",student.getStuQq());
|
||||
values.put("stuAddress",student.getStuAddress());
|
||||
db.insert(DB_NAME,null,values);
|
||||
values.clear();
|
||||
}
|
||||
|
||||
//通过学号来读取信息
|
||||
@SuppressLint("Range")
|
||||
public LinkedList<Student> readStudents(String stuNumber) {
|
||||
LinkedList<Student> students = new LinkedList<>();
|
||||
SQLiteDatabase db = this.getWritableDatabase();
|
||||
Cursor cursor = db.rawQuery("select * from tb_student where stuNumber=?",new String[]{stuNumber});
|
||||
if(cursor.moveToFirst()) {
|
||||
do {
|
||||
String stuName = cursor.getString(cursor.getColumnIndex("stuName"));
|
||||
String stuMajor = cursor.getString(cursor.getColumnIndex("stuMajor"));
|
||||
String stuPhone = cursor.getString(cursor.getColumnIndex("stuPhone"));
|
||||
String stuQq = cursor.getString(cursor.getColumnIndex("stuQq"));
|
||||
String stuAddress = cursor.getString(cursor.getColumnIndex("stuAddress"));
|
||||
Student student = new Student();
|
||||
student.setStuName(stuName);
|
||||
student.setStuMajor(stuMajor);
|
||||
student.setStuPhone(stuPhone);
|
||||
student.setStuQq(stuQq);
|
||||
student.setStuAddress(stuAddress);
|
||||
students.add(student);
|
||||
}while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
return students;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 130 KiB |
After Width: | Height: | Size: 267 KiB |
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
|
||||
<item android:state_pressed="true" android:drawable="@android:color/holo_green_light"/>
|
||||
<item android:state_pressed="false" android:drawable="@android:color/holo_green_dark"/>
|
||||
|
||||
</selector>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true" android:drawable="@drawable/shape_btn_pressed"/>
|
||||
<item android:drawable="@drawable/shape_btn_normal"/>
|
||||
</selector>
|
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--按钮按下时-->
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<!--设置圆角-->
|
||||
<corners android:radius="20dp"/>
|
||||
<!--设置背景颜色-->
|
||||
<solid android:color="#A103A9F4"/>
|
||||
</shape>
|
||||
</item>
|
||||
<!--按钮弹起时-->
|
||||
<item>
|
||||
<shape>
|
||||
<!--设置圆角-->
|
||||
<corners android:radius="100dp"/>
|
||||
<!--设置背景颜色-->
|
||||
<solid android:color="#A94CAF50"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</selector>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置圆角-->
|
||||
<corners android:radius="18dp"/>
|
||||
<!--设置背景颜色-->
|
||||
<solid android:color="#704CAF50"/>
|
||||
</shape>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<stroke android:width="3dp" android:color="@color/black"/>
|
||||
|
||||
<corners android:radius="10dp"/>
|
||||
|
||||
</shape>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_focused="true" android:drawable="@drawable/shape_edit_focus"/>
|
||||
<item android:drawable="@drawable/shape_edit_normal"/>
|
||||
</selector>
|
After Width: | Height: | Size: 760 B |
After Width: | Height: | Size: 9.6 KiB |
After Width: | Height: | Size: 8.8 KiB |
@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 138 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 446 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 7.9 KiB |
After Width: | Height: | Size: 123 KiB |
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#E91E63"/>
|
||||
<corners android:radius="30dp"/>
|
||||
<stroke android:width="1dp" android:color="#9C27B0"/>
|
||||
<padding android:bottom="2dp" android:left="2dp" android:right="2dp" android:top="2dp" />
|
||||
</shape>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#E91E63"/>
|
||||
<corners android:radius="30dp"/>
|
||||
<stroke android:width="1dp" android:color="#9C27B0"/>
|
||||
<padding android:bottom="2dp" android:left="2dp" android:right="2dp" android:top="2dp" />
|
||||
</shape>
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<solid android:color="#ffffff" />
|
||||
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#ff0000ff" />
|
||||
|
||||
<corners
|
||||
android:bottomLeftRadius="10dp"
|
||||
android:bottomRightRadius="10dp"
|
||||
android:topLeftRadius="10dp"
|
||||
android:topRightRadius="10dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="2dp"
|
||||
android:left="2dp"
|
||||
android:right="2dp"
|
||||
android:top="2dp" />
|
||||
|
||||
</shape>
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<solid android:color="#ffffff" />
|
||||
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#ffaaaaaa" />
|
||||
|
||||
<corners
|
||||
android:bottomLeftRadius="10dp"
|
||||
android:bottomRightRadius="10dp"
|
||||
android:topLeftRadius="10dp"
|
||||
android:topRightRadius="10dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="2dp"
|
||||
android:left="2dp"
|
||||
android:right="2dp"
|
||||
android:top="2dp" />
|
||||
|
||||
</shape>
|
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 129 KiB |
After Width: | Height: | Size: 131 KiB |
After Width: | Height: | Size: 145 KiB |
@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:orientation="vertical"
|
||||
android:background="@drawable/bg"
|
||||
tools:context=".BackActivity">
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:gravity="center"
|
||||
android:text="确定要退出登录"
|
||||
android:textSize="30sp"
|
||||
android:textColor="#516D2C"/>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="140dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="40dp"
|
||||
app:srcCompat="@drawable/back" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_centerVertical="true">
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_backfalse"
|
||||
android:layout_width="170dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/btn_selector"
|
||||
android:text="取消"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_backtrue"
|
||||
android:layout_width="170dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:background="@drawable/btn_selector"
|
||||
android:text="确定"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:background="@drawable/bg"
|
||||
android:orientation="vertical"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:gravity="center"
|
||||
android:text="欢迎进入活动查询软件"
|
||||
android:textColor="#516D2C"
|
||||
android:textSize="26sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:src="@drawable/tubiao"
|
||||
android:layout_gravity="center"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:background="@drawable/editext_selector"
|
||||
android:hint="请输入用户名"
|
||||
android:inputType="text"
|
||||
android:paddingLeft="10dp"
|
||||
android:textColor="#000000"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/pwd"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="110dp"
|
||||
android:hint="请输入密码"
|
||||
android:background="@drawable/editext_selector"
|
||||
android:textColor="#000000"
|
||||
android:inputType="textPassword"
|
||||
android:paddingLeft="10dp"
|
||||
android:textSize="20sp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_below="@+id/pwd"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/save_pwd"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:text="记住密码"
|
||||
android:textSize="20sp"/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/register"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="注册"
|
||||
android:textColor="#000000"
|
||||
android:gravity="right"
|
||||
android:layout_marginRight="5dp"
|
||||
android:textSize="20sp"
|
||||
android:clickable="true"/>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/loginBtn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="登录"
|
||||
android:textColor="#FFFFFF"
|
||||
android:background="@drawable/btn_selector"
|
||||
android:textSize="23sp"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="@drawable/bg">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="590dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="20dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:src="@drawable/logo2" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_updatee"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/btn_selector"
|
||||
android:text="修改"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_deletee"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/btn_selector"
|
||||
android:text="删除"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_read"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/btn_selector"
|
||||
android:text="查看"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/bt_home"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginLeft="60dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:src="@drawable/function" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/bt_add"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="100dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:src="@drawable/add" />
|
||||
<ImageButton
|
||||
android:id="@+id/bt_personal"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginLeft="100dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:src="@drawable/personal" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/tv_home_page"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="20dp"
|
||||
android:text="功能页"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginLeft="55dp" />
|
||||
<TextView
|
||||
android:id="@+id/tv_add_product"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="20dp"
|
||||
android:text="发布页"
|
||||
android:textStyle="bold"
|
||||
android:textSize="15sp"
|
||||
android:layout_marginLeft="82dp" />
|
||||
<TextView
|
||||
android:id="@+id/tv_personal_center"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="20dp"
|
||||
android:text="个人页"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginLeft="68dp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="@drawable/bg">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="20dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_student_number"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:textStyle="italic"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:src="@drawable/logo2"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_gravity="center"/>
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_user_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="个人信息"
|
||||
android:textColor="#FFFFFF"
|
||||
android:background="@drawable/btn_selector"
|
||||
android:textSize="20sp"
|
||||
android:layout_margin="10dp"/>
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_logout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="退出登录"
|
||||
android:textColor="#FFFFFF"
|
||||
android:background="@drawable/btn_selector"
|
||||
android:textSize="20sp"
|
||||
android:layout_margin="10dp"/>
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_back"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="返回"
|
||||
android:layout_margin="10dp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:background="@drawable/btn_selector"
|
||||
android:textSize="20sp"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,79 @@
|
||||
<?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:orientation="vertical"
|
||||
android:background="@drawable/bg"
|
||||
android:padding="5dp" >
|
||||
<TextView
|
||||
android:id="@+id/tv"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="具体信息如下:"
|
||||
android:textSize="22sp"
|
||||
android:textColor="#516D2C" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:src="@drawable/id"/>
|
||||
<TextView
|
||||
android:id="@+id/c_orderid"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="id"
|
||||
android:textSize="20sp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:src="@drawable/user"/>
|
||||
<TextView
|
||||
android:id="@+id/c_username"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="活动"
|
||||
android:textSize="20sp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:src="@drawable/major"/>
|
||||
<TextView
|
||||
android:id="@+id/c_name"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="时间"
|
||||
android:textSize="20sp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:src="@drawable/isbn2"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/c_price"
|
||||
android:gravity="center"
|
||||
android:text="备注"
|
||||
android:textSize="20sp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
<ListView
|
||||
android:id="@+id/lst_orders"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="537dp">
|
||||
|
||||
</ListView>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,154 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="@drawable/bg"
|
||||
android:padding="10dp"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:gravity="center"
|
||||
android:text="注册"
|
||||
android:textSize="30sp"
|
||||
android:textColor="#516D2C"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="140dp"
|
||||
android:src="@drawable/register"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="20dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/manager"
|
||||
android:layout_marginRight="5dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="用户:"
|
||||
android:textSize="20sp"
|
||||
android:gravity="center"
|
||||
android:textColor="#000000"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:hint="请输入用户名"
|
||||
android:background="@drawable/editext_selector"
|
||||
android:textSize="20sp"
|
||||
android:textColor="#000000"
|
||||
android:inputType="text"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:gravity="left|center"
|
||||
android:maxLength="20"
|
||||
android:paddingLeft="10dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@drawable/password"
|
||||
android:layout_marginRight="5dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="密码:"
|
||||
android:textSize="20sp"
|
||||
android:gravity="center"
|
||||
android:textColor="#000000"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/pwd"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:hint="请输入密码"
|
||||
android:background="@drawable/editext_selector"
|
||||
android:textSize="20sp"
|
||||
android:textColor="#000000"
|
||||
android:inputType="textPassword"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:gravity="left|center"
|
||||
android:maxLength="20"
|
||||
android:paddingLeft="10dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@drawable/key"
|
||||
android:layout_marginRight="5dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="确认密码:"
|
||||
android:textSize="20sp"
|
||||
android:gravity="center"
|
||||
android:textColor="#000000"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/pwd2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:hint="请确认密码"
|
||||
android:background="@drawable/editext_selector"
|
||||
android:textSize="20sp"
|
||||
android:textColor="#000000"
|
||||
android:inputType="textPassword"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:gravity="left|center"
|
||||
android:maxLength="20"
|
||||
android:paddingLeft="10dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/registerBtn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:text="注册"
|
||||
android:gravity="center"
|
||||
android:textSize="20sp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:background="@drawable/btn_selector"
|
||||
android:layout_marginTop="15dp"/>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:orientation="vertical"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="@drawable/bg">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_marginTop="130dp"
|
||||
android:src="@drawable/tubiao"
|
||||
android:layout_gravity="center"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,53 @@
|
||||
<?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:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:padding="3dp">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_lst_gameid"
|
||||
android:gravity="center"
|
||||
android:layout_margin="2dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="id"
|
||||
android:textSize="17sp"
|
||||
android:textColor="#000000"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_lst_gamename"
|
||||
android:gravity="center"
|
||||
android:layout_margin="2dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="活动"
|
||||
android:textSize="17sp"
|
||||
android:textColor="#000000"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_lst_gametime"
|
||||
android:layout_margin="2dp"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="时间"
|
||||
android:textSize="17sp"
|
||||
android:textColor="#000000"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_lst_gamenote"
|
||||
android:layout_margin="2dp"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="备注"
|
||||
android:textSize="17sp"
|
||||
android:textColor="#000000"/>
|
||||
</LinearLayout>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 982 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 7.6 KiB |
@ -0,0 +1,16 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.MyExamProject" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFBB86FC</color>
|
||||
<color name="purple_500">#FF6200EE</color>
|
||||
<color name="purple_700">#FF3700B3</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
</resources>
|
@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">MyExamProject</string>
|
||||
</resources>
|
@ -0,0 +1,16 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.MyExamProject" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_700</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
@ -0,0 +1,17 @@
|
||||
package com.example.myexamproject;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|