“陈双凤” 6 months ago
parent 384fdc6e23
commit a364662c29

@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
</component>
</project>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<value>
<entry key="app">
<State />
</entry>
</value>
</component>
</project>

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveExternalAnnotations" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

@ -0,0 +1 @@
/build

@ -0,0 +1,39 @@
plugins {
id("com.android.application")
}
android {
namespace = "com.example.memosystem"
compileSdk = 33
defaultConfig {
applicationId = "com.example.memosystem"
minSdk = 31
targetSdk = 33
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
dependencies {
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.8.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
}

@ -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.memosystem;
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.memosystem", appContext.getPackageName());
}
}

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MemoSystem"
tools:targetApi="31">
<activity
android:name=".activity.AddActivity"
android:exported="false" />
<activity
android:name=".activity.MesActivity"
android:exported="false" />
<activity
android:name=".activity.ChangePwdActivity"
android:exported="false" />
<activity
android:name=".activity.RegisterActivity"
android:exported="false" />
<activity
android:name=".activity.ManageActivity"
android:exported="false" />
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

@ -0,0 +1,88 @@
package com.example.memosystem;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.example.memosystem.activity.AddActivity;
import com.example.memosystem.activity.ChangePwdActivity;
import com.example.memosystem.activity.ManageActivity;
import com.example.memosystem.activity.MesActivity;
import com.example.memosystem.activity.RegisterActivity;
import com.example.memosystem.dao.AdminDao;
import com.example.memosystem.util.DBUtil;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//这段代码是连接数据库的
DBUtil dbUtil=new DBUtil(MainActivity.this);
SQLiteDatabase db=dbUtil.getWritableDatabase();
DBUtil.db=db;
//------------------------
//去注册界面
Button to_reg=findViewById(R.id.register_button);
to_reg.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(MainActivity.this, "注册界面", Toast.LENGTH_SHORT).show();
Intent intent=new Intent(MainActivity.this, RegisterActivity.class);
startActivity(intent);
}
});
//登录按钮
EditText ac=findViewById(R.id.login_account);
EditText pwd=findViewById(R.id.login_pwd);
Button bu=findViewById(R.id.login_button);
bu.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String acT=ac.getText().toString().trim();
String pwdT=pwd.getText().toString().trim();
if(acT.isEmpty()){
Toast.makeText(MainActivity.this, "请输入账号!", Toast.LENGTH_SHORT).show();
}else if(pwdT.isEmpty()) {
Toast.makeText(MainActivity.this, "请输入密码!", Toast.LENGTH_SHORT).show();
}else{
AdminDao adminDao=new AdminDao();
int a=adminDao.loginAdmin(acT,pwdT);
if(a==0){
Toast.makeText(MainActivity.this, "账号不存在或者密码错误!", Toast.LENGTH_SHORT).show();
}else{
Intent intent=new Intent(MainActivity.this, ManageActivity.class);
intent.putExtra("account",acT);
startActivity(intent);
Toast.makeText(MainActivity.this, "登录成功!", Toast.LENGTH_SHORT).show();
}
}
}
});
}
}

@ -0,0 +1,168 @@
package com.example.memosystem.activity;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.example.memosystem.MainActivity;
import com.example.memosystem.R;
import com.example.memosystem.activity.listen.ChangeListen;
import com.example.memosystem.dao.AdminDao;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.UUID;
public class AddActivity extends AppCompatActivity {
String uuid=null;
String account=null;
EditText res=null;
EditText title=null;
TextView textView=null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add);
//加载菜单条
Toolbar toolbar = findViewById(R.id.toolbar_add);
setSupportActionBar(toolbar);
//获取账号
Intent intent=getIntent();
textView= findViewById(R.id.add_time);
//获取当前月份和时间
Calendar calendar=Calendar.getInstance();
SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy年MM月dd日 a HH:mm");
String curTime=dateFormat.format(calendar.getTime());
curTime=curTime+" | ";
curTime=curTime+"0字";
textView.setText(curTime);
//是根据下面输入下面文本框的操作时间来定的
res=findViewById(R.id.add_con);//输入内容的
title=findViewById(R.id.add_title);//输入内容的
//判断是添加界面还是更改界面
account=intent.getStringExtra("account");//获取当前账号
String a=intent.getStringExtra("sta");
if(a==null){//是添加界面
uuid = UUID.randomUUID().toString();//随机产生的一个UUID
}else{
intent.putExtra("sta","1");
uuid=intent.getStringExtra("id");
res.setText( intent.getStringExtra("con"));
title.setText( intent.getStringExtra("title"));
textView.setText(intent.getStringExtra("time"));
}
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent1=new Intent(AddActivity.this,ManageActivity.class);
intent1.putExtra("account",account);
startActivity(intent1);
}
});
res.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
//获取当前月份和时间
Calendar calendar=Calendar.getInstance();
SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy年MM月dd日 a HH:mm");
String curTime=dateFormat.format(calendar.getTime());
curTime=curTime+" | ";
String text= String.valueOf(res.getText());
String zi=String.valueOf(text.length());
curTime=curTime+zi+"字";
textView.setText(curTime);
//每次输入一个字符,他都自动保存一下
String titles=title.getText().toString().trim();
String rest=res.getText().toString().trim();
int a=new AdminDao().saveRecord(uuid, titles,rest,account,curTime);
}
});
}
//构造菜单
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.add_menu,menu);
return true;
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
int itemID=item.getItemId();
if(itemID==R.id.add_men_save){//保存
String curTime=textView.getText().toString().trim();
String titles=title.getText().toString().trim();
String rest=res.getText().toString().trim();
int a=new AdminDao().saveRecord(uuid, titles,rest,account,curTime);
if(a==1){
Toast.makeText(AddActivity.this, "保存成功!", Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(AddActivity.this, "保存失败!", Toast.LENGTH_SHORT).show();
}
}else
if(itemID==R.id.add_men_del){//删除
int a=new AdminDao().delRecord(uuid,account);
Intent intent=new Intent(AddActivity.this,ManageActivity.class);
intent.putExtra("account",account);
startActivity(intent);
}
return super.onOptionsItemSelected(item);
}
}

@ -0,0 +1,106 @@
package com.example.memosystem.activity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AbsListView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.example.memosystem.MainActivity;
import com.example.memosystem.R;
import com.example.memosystem.activity.listen.ChangeListen;
import com.example.memosystem.activity.listen.TouchListen;
import com.example.memosystem.dao.AdminDao;
public class ChangePwdActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_change_pwd);
Intent intent=getIntent();
String account=intent.getStringExtra("account");
Toolbar toolbar= findViewById(R.id.toolbar_pwd);
this.setSupportActionBar(toolbar);
//返回功能
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent1=new Intent(ChangePwdActivity.this,ManageActivity.class);
intent1.putExtra("account",account);
startActivity(intent1);
}
});
EditText one=findViewById(R.id.change_pwd_one);
one.addTextChangedListener(new ChangeListen(one));
EditText two=findViewById(R.id.change_pwd_two);
two.addTextChangedListener(new ChangeListen(two));
one.setOnTouchListener(new TouchListen(one));
two.setOnTouchListener(new TouchListen(two));
//初始X的状态
one.setCompoundDrawablesRelativeWithIntrinsicBounds(0,0,0,0);
two.setCompoundDrawablesRelativeWithIntrinsicBounds(0,0,0,0);
Button but=findViewById(R.id.change_pwd_button);
but.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String ontT=one.getText().toString().trim();
String twoT=two.getText().toString().trim();
if(ontT.isEmpty()){
Toast.makeText(ChangePwdActivity.this, "请输入密码!", Toast.LENGTH_SHORT).show();
}else if(twoT.isEmpty()){
Toast.makeText(ChangePwdActivity.this, "请输入确认密码!", Toast.LENGTH_SHORT).show();
}else if(!ontT.equals(twoT)){
Toast.makeText(ChangePwdActivity.this, "两次密码输入不一致!", Toast.LENGTH_SHORT).show();
}else{
AdminDao adminDao=new AdminDao();
int a=adminDao.changePassword(account,ontT);
if(a==0){
Toast.makeText(ChangePwdActivity.this, "更改失败!", Toast.LENGTH_SHORT).show();
}else
if(a>=1){
Toast.makeText(ChangePwdActivity.this, "修改密码成功", Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(ChangePwdActivity.this, "未知错误", Toast.LENGTH_SHORT).show();
}
}
}
});
//写返回功能
}
}

@ -0,0 +1,133 @@
package com.example.memosystem.activity;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ListView;
import com.example.memosystem.MainActivity;
import com.example.memosystem.R;
import com.example.memosystem.adapter.RecordAdapter;
import com.example.memosystem.bean.Record;
import com.example.memosystem.dao.AdminDao;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.navigation.NavigationView;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class ManageActivity extends AppCompatActivity {
//侧边栏的内容部分
private ListView listView;
List<Record> originalItems;
RecordAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_manage);
Intent intent=getIntent();
String account=intent.getStringExtra("account");
//退出的功能
NavigationView navigationView=findViewById(R.id.navigation_view);//引入侧边栏
navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
int id=item.getItemId();
if(id==R.id.menu_to_exit){
finishAffinity();//退出功能
}
if(id==R.id.menu_to_login){
Intent intent=new Intent(ManageActivity.this, MainActivity.class);
startActivity(intent);
}
if(id==R.id.menu_up_pwd){
Intent intent=new Intent(ManageActivity.this, ChangePwdActivity.class);
intent.putExtra("account",account);
startActivity(intent);
}
if(id==R.id.menu_mes){
Intent intent=new Intent(ManageActivity.this, MesActivity.class);
intent.putExtra("account",account);
startActivity(intent);
}
return true;
}
});
//添加事件的点击按钮
FloatingActionButton floatingActionButton=findViewById(R.id.fab);
floatingActionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent(ManageActivity.this, AddActivity.class);
intent.putExtra("account",account);
startActivity(intent);
}
});
//现在开发加载列表
listView= findViewById(R.id.manage_list);
//这个列表要从哪里读取数据
originalItems=new ArrayList<>();
//读取数据
originalItems= new AdminDao().showRecord(account);
if(originalItems.size()==0){
listView.setAdapter(null);//让界面啥都不显示
}else{
adapter = new RecordAdapter(this, originalItems);
listView.setAdapter(adapter);
}
Toolbar toolbar= findViewById(R.id.toolbar_man);
this.setSupportActionBar(toolbar);
//返回功能
DrawerLayout drawerLayout =findViewById(R.id.drawer);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
drawerLayout.openDrawer(GravityCompat.START);
}
});
//originalItems=new ArrayList<>();
}
}

@ -0,0 +1,134 @@
package com.example.memosystem.activity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.Toast;
import com.example.memosystem.MainActivity;
import com.example.memosystem.R;
import com.example.memosystem.activity.listen.ChangeListen;
import com.example.memosystem.activity.listen.TouchListen;
import com.example.memosystem.dao.AdminDao;
import java.util.Map;
public class MesActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_mes);
Intent intent=getIntent();
String account=intent.getStringExtra("account");
//需要查看个人信息
Map<String, String> result = new AdminDao().showAccountMes(account);
Toolbar toolbar= findViewById(R.id.toolbar_mes);
this.setSupportActionBar(toolbar);
//返回功能
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent1=new Intent(MesActivity.this,ManageActivity.class);
intent1.putExtra("account",account);
startActivity(intent1);
}
});
//姓名
EditText name=findViewById(R.id.change_name);//姓名
name.setText(result.get("name"));
RadioButton man=findViewById(R.id.change_man);//男
RadioButton woman=findViewById(R.id.change_woman);//女
if(result.get("sex").equals("男")){
man.setChecked(true);
}else{
woman.setChecked(true);
}
EditText age=findViewById(R.id.change_age);//男
age.setText(result.get("age"));
EditText phone=findViewById(R.id.change_phone);//男
phone.setText(result.get("phone"));
clearText(name);
clearText(age);
clearText(phone);
Button change_pwd_button = findViewById(R.id.change_pwd_button);
change_pwd_button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String nameT=name.getText().toString().trim();
String ageT=age.getText().toString().trim();
String phoneT=phone.getText().toString().trim();
if(nameT.isEmpty()){
Toast.makeText(MesActivity.this, "请输入姓名!", Toast.LENGTH_SHORT).show();
}else if(phoneT.isEmpty()){
Toast.makeText(MesActivity.this, "请输入联系方式!", Toast.LENGTH_SHORT).show();
}else if(ageT.isEmpty()){
Toast.makeText(MesActivity.this, "请输入年纪!", Toast.LENGTH_SHORT).show();
}else{
String sex="女";
if(man.isChecked()){
sex="男";
}
int a=new AdminDao().changeMes(account,nameT,sex,phoneT,ageT);
if(a>=1){
Toast.makeText(MesActivity.this, "更改个人信息成功!", Toast.LENGTH_SHORT).show();
}
if(a==0){
Toast.makeText(MesActivity.this, "更改失败!", Toast.LENGTH_SHORT).show();
}
if(a==-1){
Toast.makeText(MesActivity.this, "未知错误!", Toast.LENGTH_SHORT).show();
}
}
}
});
}
private void clearText(EditText text){
text.addTextChangedListener(new ChangeListen(text));
text.setOnTouchListener(new TouchListen( text));
//初始X的状态
text.setCompoundDrawablesRelativeWithIntrinsicBounds(0,0,0,0);
}
}

@ -0,0 +1,98 @@
package com.example.memosystem.activity;
/**
*
*
*/
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.example.memosystem.MainActivity;
import com.example.memosystem.R;
import com.example.memosystem.dao.AdminDao;
public class RegisterActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
EditText account = findViewById(R.id.register_account);//账号
EditText pwd = findViewById(R.id.register_pwd);//密码
EditText name = findViewById(R.id.register_name);//姓名
RadioButton woman = findViewById(R.id.register_woman);//女
RadioButton man = findViewById(R.id.register_man);//男
man.setChecked(true);
EditText phone = findViewById(R.id.register_phone);//手机号
EditText age = findViewById(R.id.register_age);
Button button = findViewById(R.id.register_button);//点击注册按钮
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String accountT=account.getText().toString().trim();
String pwdT=pwd.getText().toString().trim();
String nameT=name.getText().toString().trim();
String phoneT=phone.getText().toString().trim();
String ageT=age.getText().toString().trim();
if(accountT.isEmpty()){
Toast.makeText(RegisterActivity.this, "请输入账号!", Toast.LENGTH_SHORT).show();
}else if(pwdT.isEmpty()){
Toast.makeText(RegisterActivity.this, "请输入密码!", Toast.LENGTH_SHORT).show();
}else if(nameT.isEmpty()){
Toast.makeText(RegisterActivity.this, "请输入姓名!", Toast.LENGTH_SHORT).show();
}else if(phoneT.isEmpty()){
Toast.makeText(RegisterActivity.this, "请输入联系方式!", Toast.LENGTH_SHORT).show();
}else if(ageT.isEmpty()){
Toast.makeText(RegisterActivity.this, "请输入年纪!", Toast.LENGTH_SHORT).show();
}else{
String sex="女";
if(man.isChecked()){
sex="男";
}
AdminDao adminDao=new AdminDao();
int a= adminDao.registerAdmin(accountT,pwdT,nameT,sex,phoneT,ageT);
if(a==1){
Toast.makeText(RegisterActivity.this, "注册成功!", Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(RegisterActivity.this, "注册失败,账号冲突!", Toast.LENGTH_SHORT).show();
}
}
}
});
Button Login = findViewById(R.id.register_to_login_button);//点击注册按钮 实现返回按钮
Login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(RegisterActivity.this, "登录界面", Toast.LENGTH_SHORT).show();
Intent intent=new Intent(RegisterActivity.this, MainActivity.class);
startActivity(intent);
}
});
}
}

@ -0,0 +1,38 @@
package com.example.memosystem.activity.listen;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
import com.example.memosystem.R;
public class ChangeListen implements TextWatcher {
private EditText ed=null;
public ChangeListen(EditText ed){
this.ed=ed;
}
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
if(editable.length()>0){
ed.setCompoundDrawablesRelativeWithIntrinsicBounds(0,0,R.drawable.x,0);
}else{
ed.setCompoundDrawablesRelativeWithIntrinsicBounds(0,0,0,0);
}
}
}

@ -0,0 +1,39 @@
package com.example.memosystem.activity.listen;
import android.view.MotionEvent;
import android.view.View;
import android.widget.EditText;
public class TouchListen implements View.OnTouchListener{
private EditText ed=null;
public TouchListen(EditText ed){
this.ed=ed;
}
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
//
int start=ed.getWidth()-ed.getPaddingEnd()-ed.getPaddingRight();
int end=ed.getWidth();//整个文本的宽带
float x = motionEvent.getX();
boolean isButtonClicked=x>start&&x<end;
if(isButtonClicked){
if(motionEvent.getAction()==MotionEvent.ACTION_UP){
//判断是否鼠标抬起
ed.setText("");
return true;
}
}
return false;
}
}

@ -0,0 +1,70 @@
package com.example.memosystem.adapter;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.memosystem.R;
import com.example.memosystem.activity.AddActivity;
import com.example.memosystem.bean.Record;
import java.util.List;
public class RecordAdapter extends ArrayAdapter<Record> {
private List<Record> items;
public RecordAdapter( Context context, List<Record> items) {
super(context, R.layout.manage_list,items);
this.items=items;
}
@Override
public View getView(int position,View convertView,ViewGroup parent) {
if( convertView==null){
LayoutInflater inflater=LayoutInflater.from(getContext());
convertView=inflater.inflate(R.layout.manage_list,parent,false);
}
TextView title=convertView.findViewById(R.id.title);
TextView con=convertView.findViewById(R.id.con);
TextView time=convertView.findViewById(R.id.time);
Record res = items.get(position);
title.setText(res.getTitle());
con.setText(res.getCon());
time.setText(res.getTim());
convertView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent =new Intent(getContext(), AddActivity.class);//目标i界面
intent.putExtra("sta","1");
intent.putExtra("account",res.getUid());//账号
intent.putExtra("id",res.getId());
intent.putExtra("title",res.getTitle());
intent.putExtra("con",res.getCon());
intent.putExtra("time",res.getTim());
getContext().startActivity(intent);//打开目标界面
}
});
return convertView;
}
}

@ -0,0 +1,73 @@
package com.example.memosystem.bean;
public class Record {
private String id;
private String title;
private String con;
private String uid;
private String tim;
//alt install
@Override
public String toString() {
return "Record{" +
"id='" + id + '\'' +
", title='" + title + '\'' +
", con='" + con + '\'' +
", uid='" + uid + '\'' +
", tim='" + tim + '\'' +
'}';
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getCon() {
return con;
}
public void setCon(String con) {
this.con = con;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public String getTim() {
return tim;
}
public void setTim(String tim) {
this.tim = tim;
}
public Record() {
}
public Record(String id, String title, String con, String uid, String tim) {
this.id = id;
this.title = title;
this.con = con;
this.uid = uid;
this.tim = tim;
}
}

@ -0,0 +1,154 @@
package com.example.memosystem.dao;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.example.memosystem.bean.Record;
import com.example.memosystem.dao.impl.AdminDaoImpl;
import com.example.memosystem.util.DBUtil;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AdminDao implements AdminDaoImpl {
SQLiteDatabase db= DBUtil.db;
@Override
public int registerAdmin(String ...da) {
try {
db.execSQL("INSERT INTO d_admin VALUES(?,?,?,?,?,?)",da);
return 1;
}catch (Exception e){
return -1;
}
}
@Override
public int loginAdmin(String... da) {
int a=0;
Cursor res = db.rawQuery("select * from d_admin where s_id=? and s_pwd=?", da);
if(res.moveToNext()){
a++;
}
return a;
}
/**
*
* @param da
* @return
*/
@Override
public int changePassword(String... da) {
ContentValues values=new ContentValues();
values.put("s_pwd", da[1]);
String das[]={da[0]};
try{
return db.update("d_admin",values,"s_id=?",das);
}catch (Exception e){
return -1;
}
}
public int changeMes(String ...da){
ContentValues values=new ContentValues();
values.put("s_name", da[1]);
values.put("s_sex", da[2]);
values.put("s_phone", da[3]);
values.put("s_age", da[4]);
String das[]={da[0]};
try{
return db.update("d_admin",values,"s_id=?",das);
}catch (Exception e){
return -1;
}
}
public Map<String,String> showAccountMes(String account){
Map<String,String> map=new HashMap<>();
String da[]={account};
Cursor result = db.rawQuery("select s_name,s_sex,s_phone,s_age from d_admin where s_id=?", da);
while(result.moveToNext()){
//姓名
//姓名
//手机号
//年纪
String name = result.getString(0);
String sex= result.getString(1);
String phone= result.getString(2);
String age= result.getString(3);
map.put("name",name);
map.put("sex",sex);
map.put("phone",phone);
map.put("age",age);
}
return map;
}
/**
*
* @param da
* @return
*/
@Override
public int delRecord(String... da) {
try {
db.execSQL("delete from d_record where s_id=? and s_uid=?",da);
return 1;
}catch (Exception e){
return -1;
}
}
public int saveRecord(String ...da){//id 标题 内容 用户ID 时间
try {
db.execSQL("INSERT INTO d_record VALUES(?,?,?,?,?)",da);
return 1;
}catch (Exception e){
String daa[]={da[1],da[2],da[4],da[0],da[3]};
try {
db.execSQL("update d_record set s_title=? ,s_con=?,s_time=? where s_id=? and s_uid=?",daa);
return 1;
}catch (Exception ee){
e.printStackTrace();
ee.printStackTrace();
return -1;
}
}
}
public List<Record> showRecord(String id){
String da[]={id};
List<Record> re=new ArrayList<>();//存储所有备忘录的
Cursor res = db.rawQuery("select * from d_record where s_uid=?",da);
while(res.moveToNext()){
Record record=new Record(res.getString(0),res.getString(1),res.getString(2),res.getString(3),res.getString(4));
re.add(record);
}
return re;
}
}

@ -0,0 +1,39 @@
package com.example.memosystem.dao.impl;
import com.example.memosystem.bean.Record;
import java.util.List;
import java.util.Map;
/**
*
*/
public interface AdminDaoImpl {
/**
*
*/
public int registerAdmin(String ...da);
/**
*
* @param da
* @return
*/
public int loginAdmin(String ...da);
public int changePassword(String ...da);
public int changeMes(String ...da);
public Map<String,String> showAccountMes(String account);
public int delRecord(String ...da);
public int saveRecord(String ...da);
public List<Record> showRecord(String id);
}

@ -0,0 +1,56 @@
package com.example.memosystem.util;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
//alt +回车
public class DBUtil extends SQLiteOpenHelper {
private static final String DATABASE_NAME="db_memo.db";//数据库名字
public static SQLiteDatabase db=null;//用他来操作数据库
private static final int DATABASE_VERSION=3;//每一次对数据库脚本的更新都需要将这个数字进行加1
public DBUtil(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION,null);
}
@Override
public void onCreate(SQLiteDatabase db) {//数据库初始化加载的代码
db.execSQL("PRAGMA foreign_keys = false");
db.execSQL("drop table if exists d_admin");//如果这个表存在则删除
db.execSQL("CREATE TABLE d_admin (s_id varchar(20) primary key," +
" s_pwd varchar(20)," +
" s_name varchar(20)," +
" s_sex varchar(20)," +
" s_phone varchar(20)," +
" s_age varchar(20) )");
db.execSQL("INSERT INTO d_admin VALUES('root','123456','小铭','男','5696331','18')");
//-------------管理员 表
//编号 标题 内容 时间
db.execSQL("drop table if exists d_record");//如果这个表存在则删除
db.execSQL("CREATE TABLE d_record (s_id varchar(50) primary key," +
" s_title varchar(20)," +
" s_con text," +
" s_uid varchar(20)," +//用户ID
" s_time varchar(20) )");
db.execSQL("INSERT INTO d_record VALUES('1','记录一下今天的生活','今天吃了好多零食,看了很多电视剧.','root','2023年9月10日 上午 1256')");
// db.execSQL("PRAGMA foreign_keys = true");
}
@Override
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {//数据库变动则执行
onCreate(sqLiteDatabase);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 950 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 KiB

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="#CCFFFFFF"></solid>
<corners android:radius="20dp"></corners>
</shape>
</item>
<item android:state_focused="true">
<shape>
<solid android:color="#ADFFFFFF"></solid>
<corners android:radius="20dp"></corners>
</shape>
</item>
<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="#000000">
</ripple>
</selector>

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true">
<shape>
<solid android:color="#FFFFFF"></solid>
<corners android:radius="5dp"></corners>
<stroke android:width="1dp" android:color="#f88d2f" />
</shape>
</item>
<item android:state_focused="false">
<shape>
<solid android:color="#FFFFFF"></solid>
<corners android:radius="5dp"></corners>
<stroke android:width="1dp" android:color="#d6d6d6" />
</shape>
</item>
</selector>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="#99F1F1F1"></solid>
<corners android:radius="10dp"></corners>
<stroke android:width="1dp" android:color="#FFA000" />
</shape>
</item>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:state_pressed="true">
<solid android:color="#88ada4"></solid>
<corners android:radius="10dp"></corners>
</shape>
</item>
<item android:state_pressed="false">
<shape >
<solid android:color="#88ada4"></solid>
<corners android:radius="10dp"></corners>
</shape>
</item>
</selector>

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true">
<shape>
<solid android:color="#FFFFFF"></solid>
<corners android:radius="10dp"></corners>
<stroke android:width="1dp" android:color="#ed6e99" />
</shape>
</item>
<item android:state_focused="false">
<shape>
<solid android:color="#FFFFFF"></solid>
<corners android:radius="10dp"></corners>
<stroke android:width="1dp" android:color="#d6d6d6" />
</shape>
</item>
</selector>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="#FFFFFF"></solid>
<corners android:radius="35dp"></corners>
</shape>
</item>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 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>

@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="#40FFFFFF"></solid>
<corners android:radius="20dp"></corners>
</shape>
</item>
<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="#000000">
</ripple>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.AddActivity"
android:orientation="vertical"
>
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_add"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:title="备忘录"
app:navigationIcon="@drawable/back"
/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="20dp"
android:layout_marginTop="20dp"
>
<EditText
android:id="@+id/add_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="标题"
android:textStyle="bold"
android:textSize="30sp"
android:background="@null"
/>
<TextView
android:id="@+id/add_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="时间"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:textSize="15sp"
android:textStyle="bold"
/>
<EditText
android:id="@+id/add_con"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入内容"
android:textStyle="bold"
android:textSize="20sp"
android:background="@null"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>

@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.ChangePwdActivity"
android:orientation="vertical"
>
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_pwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="#b0d097"
app:title="修改密码"
app:navigationIcon="@drawable/back"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/bglv">
<LinearLayout
android:background="@drawable/change_style"
android:layout_width="match_parent"
android:layout_height="450dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="105dp"
android:orientation="vertical"
android:paddingLeft="20dp"
android:paddingRight="20dp"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="80dp"
android:src="@drawable/grzy"
android:layout_marginTop="30dp"
android:layout_marginBottom="40dp"
/>
<EditText
android:id="@+id/change_pwd_one"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入密码"
android:background="@drawable/change_pwd_edit_style"
android:inputType="textPassword"
android:paddingLeft="30dp"
android:paddingRight="40dp"
android:paddingBottom="15dp"
android:paddingTop="15dp"
android:layout_marginBottom="30dp"
android:drawableRight="@drawable/x"
android:textSize="20sp"
>
</EditText>
<EditText
android:id="@+id/change_pwd_two"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入确认密码"
android:paddingLeft="30dp"
android:paddingRight="40dp"
android:paddingBottom="15dp"
android:paddingTop="15dp"
android:drawableRight="@drawable/x"
android:inputType="textPassword"
android:background="@drawable/change_pwd_edit_style"
android:layout_marginBottom="30dp"
android:textSize="20sp"
>
</EditText>
<!-- 移除 android:foreground 属性 -->
<Button
android:id="@+id/change_pwd_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="修改密码"
android:textColor="#ffffff"
android:background="@drawable/change_pwd_button_style"
android:foreground="?selectableItemBackground"
android:textSize="20sp"
android:paddingBottom="15dp"
android:paddingTop="15dp"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,84 @@
<?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="wrap_content"
tools:context=".MainActivity"
android:orientation="vertical"
android:background="@drawable/bgfa"
android:gravity="center_vertical|center_horizontal"
android:paddingLeft="30dp"
android:paddingRight="30dp"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Memon"
android:textSize="40sp"
android:textColor="#ed6e99"
android:layout_marginBottom="40dp"
android:gravity="center_vertical|center_horizontal"
android:textStyle="bold"
/>
<EditText
android:id="@+id/login_account"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="30dp"
android:backgroundTint="#ed6e99"
android:hint="请输入账号"
android:textSize="20sp"
android:inputType="text"
android:textColor="#ffadbb"
android:textColorHint="#ffd5d9"
/>
<EditText
android:id="@+id/login_pwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入密码"
android:textSize="20sp"
android:textColorHint="#ffd5d9"
android:backgroundTint="#ed6e99"
android:textColor="#ffadbb"
android:inputType="textPassword"
android:layout_marginBottom="30dp"
/>
<Button
android:id="@+id/login_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="安全登录"
android:layout_marginBottom="16dp"
android:textStyle="bold"
android:background="@drawable/button_style"
android:foreground="?selectableItemBackground"
/>
<Button
android:id="@+id/register_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="账号注册"
android:layout_marginBottom="145dp"
android:textStyle="bold"
android:background="@drawable/button_style"
android:foreground="?selectableItemBackground"
/>
</LinearLayout>

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout
xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.ManageActivity">
<!--主界面-->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_man"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="#ffadbb"
app:title="@string/app_name"
app:navigationIcon="@drawable/line"
/>
<ListView
android:id="@+id/manage_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/toolbar_man"
android:padding="20dp"
android:divider="#00000000"
android:dividerHeight="18dp"
/>
</RelativeLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="45dp"
app:elevation="6dp"
app:srcCompat="@drawable/add"
app:backgroundTint="#0288D1"
/>
</FrameLayout>
<!--侧边栏-->
<com.google.android.material.navigation.NavigationView
android:id="@+id/navigation_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fed0d0"
android:layout_gravity="start"
android:orientation="vertical"
app:menu="@menu/manage_menu"
app:headerLayout="@layout/head_layout"
/>
</androidx.drawerlayout.widget.DrawerLayout>

@ -0,0 +1,186 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.MesActivity"
android:orientation="vertical"
>
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_mes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="#b0d097"
app:title="修改个人信息"
app:navigationIcon="@drawable/back"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/bglv">
<LinearLayout
android:background="@drawable/change_style"
android:layout_width="match_parent"
android:layout_height="450dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="105dp"
android:orientation="vertical"
android:paddingLeft="20dp"
android:paddingRight="20dp"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="80dp"
android:src="@drawable/grzy"
android:layout_marginTop="30dp"
android:layout_marginBottom="20dp"
/>
<EditText
android:id="@+id/change_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入姓名"
android:background="@drawable/change_mes_edit_style"
android:inputType="text"
android:paddingLeft="30dp"
android:paddingRight="40dp"
android:layout_marginBottom="10dp"
android:drawableRight="@drawable/x"
android:paddingTop="15dp"
android:paddingBottom="15dp"
/>
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:orientation="horizontal"
android:paddingLeft="30dp"
android:paddingRight="40dp"
>
<RadioButton
android:id="@+id/change_man"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="男"
android:textSize="20sp"
android:layout_weight="1"
android:textStyle="bold"
android:textColor="#616161"
android:buttonTint="#e8cb06"
/>
<RadioButton
android:id="@+id/change_woman"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="女"
android:textSize="20sp"
android:layout_weight="1"
android:textStyle="bold"
android:textColor="#616161"
android:buttonTint="#e8cb06"
/>
</RadioGroup>
<EditText
android:id="@+id/change_phone"
android:hint="请输入联系方式"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/change_mes_edit_style"
android:inputType="text"
android:paddingLeft="30dp"
android:paddingRight="40dp"
android:layout_marginBottom="10dp"
android:drawableRight="@drawable/x"
android:paddingTop="15dp"
android:paddingBottom="15dp"
/>
<EditText
android:id="@+id/change_age"
android:hint="请输入年龄"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/change_mes_edit_style"
android:inputType="text"
android:paddingLeft="30dp"
android:paddingRight="40dp"
android:layout_marginBottom="10dp"
android:drawableRight="@drawable/x"
android:paddingTop="15dp"
android:paddingBottom="15dp"
/>
<!-- 移除 android:foreground 属性 -->
<Button
android:id="@+id/change_pwd_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="修改个人信息"
android:textColor="#FFFFFF"
android:background="@drawable/change_pwd_button_style"
android:foreground="?selectableItemBackground"
android:paddingBottom="15dp"
android:paddingTop="15dp"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,158 @@
<?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="wrap_content"
tools:context=".activity.RegisterActivity"
android:orientation="vertical"
android:background="@drawable/bgfa"
android:gravity="center_vertical|center_horizontal"
android:paddingLeft="30dp"
android:paddingRight="30dp"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Memon"
android:textSize="35sp"
android:textColor="#ed6e99"
android:layout_marginBottom="10dp"
android:gravity="center_vertical|center_horizontal"
android:textStyle="bold"
/>
<EditText
android:id="@+id/register_account"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入账号"
android:textSize="20sp"
android:textColorHint="#ffd5d9"
android:backgroundTint="#ed6e99"
android:layout_marginBottom="0dp"
android:textColor="#ffadbb"
android:inputType="textCapWords"
/>
<EditText
android:id="@+id/register_pwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入密码"
android:textSize="20sp"
android:textColorHint="#ffd5d9"
android:backgroundTint="#ed6e99"
android:textColor="#ffadbb"
android:inputType="textPassword"
android:layout_marginBottom="0dp"
/>
<EditText
android:id="@+id/register_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入姓名"
android:textSize="20sp"
android:textColorHint="#ffd5d9"
android:backgroundTint="#ed6e99"
android:textColor="#ffadbb"
android:inputType="text"
android:layout_marginBottom="5dp"
/>
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/radio_style"
android:foreground="?selectableItemBackground"
android:layout_marginBottom="5dp"
>
<RadioButton
android:id="@+id/register_man"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="男"
android:textSize="20sp"
android:textColor="#ffadbb"
android:layout_weight="1"
android:textStyle="bold"
/>
<RadioButton
android:id="@+id/register_woman"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="女"
android:textSize="20sp"
android:textColor="#ffadbb"
android:layout_weight="1"
android:textStyle="bold"
/>
</RadioGroup>
<EditText
android:id="@+id/register_phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入联系方式"
android:textSize="20sp"
android:textColorHint="#ffd5d9"
android:backgroundTint="#ed6e99"
android:textColor="#ffadbb"
android:inputType="number"
android:layout_marginBottom="0dp"
/>
<EditText
android:id="@+id/register_age"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入年纪"
android:textSize="20sp"
android:textColorHint="#ffd5d9"
android:backgroundTint="#ed6e99"
android:textColor="#ffadbb"
android:inputType="text"
android:layout_marginBottom="15dp"
/>
<Button
android:id="@+id/register_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="账号注册"
android:layout_marginBottom="16dp"
android:textStyle="bold"
android:background="@drawable/button_style"
android:foreground="?selectableItemBackground"
/>
<Button
android:id="@+id/register_to_login_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="返回登录"
android:layout_marginBottom="110dp"
android:textStyle="bold"
android:background="@drawable/button_style"
android:foreground="?selectableItemBackground"
/>
</LinearLayout>

@ -0,0 +1,19 @@
<?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="wrap_content"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="239dp"
android:layout_gravity="start"
android:adjustViewBounds="true"
android:gravity="center"
android:scaleType="fitXY"
android:src="@drawable/mbgfa" />
</LinearLayout>

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/change_mes_manage_style"
android:foreground="?selectableItemBackground"
android:paddingLeft="10dp"
android:layout_marginBottom="10dp"
>
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:textStyle="bold"
android:layout_marginBottom="8dp"
/>
<TextView
android:id="@+id/con"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="15sp"
android:layout_marginBottom="5dp"
/>
<TextView
android:id="@+id/time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="15sp"
android:paddingStart="60dp"
/>
</LinearLayout>

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/add_men_del"
android:icon="@drawable/ljt"
android:title="保存"
app:showAsAction="always" />
<item
android:id="@+id/add_men_save"
android:icon="@drawable/dui"
android:title="保存"
app:showAsAction="always"
/>
</menu>

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_mes"
android:title="个人信息"
android:icon="@drawable/mes"
/>
<item
android:id="@+id/menu_up_pwd"
android:title="修改密码"
android:icon="@drawable/key"/>
<item
android:id="@+id/menu_to_login"
android:title="注销"
android:icon="@drawable/to"/>
<item
android:id="@+id/menu_to_exit"
android:title="退出"
android:icon="@drawable/exit"/>
</menu>

@ -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="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/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="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

@ -0,0 +1,7 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Base.Theme.MemoSystem" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Customize your dark theme here. -->
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
</style>
</resources>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFFFFF</color>
</resources>

@ -0,0 +1,3 @@
<resources>
<string name="app_name">备忘录</string>
</resources>

@ -0,0 +1,12 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Base.Theme.MemoSystem" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge">
<!-- Customize your light theme here.
Theme.MaterialComponents.DayNight.DarkActionBar.Bridge
-->
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
</style>
<style name="Theme.MemoSystem" parent="Base.Theme.MemoSystem" />
</resources>

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See https://developer.android.com/guide/topics/data/autobackup
for details.
Note: This file is ignored for devices older that API 31
See https://developer.android.com/about/versions/12/backup-restore
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="device.xml"/>
-->
</full-backup-content>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>

@ -0,0 +1,17 @@
package com.example.memosystem;
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);
}
}

@ -0,0 +1,7 @@
buildscript {
val agp_version by extra("8.0.1")
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.0.1" apply false
}

@ -0,0 +1,21 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true

Binary file not shown.

@ -0,0 +1,6 @@
#Tue Aug 22 17:59:58 CST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

185
MemoSystem/gradlew vendored

@ -0,0 +1,185 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"

@ -0,0 +1,89 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

@ -0,0 +1,18 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "MemoSystem"
include(":app")
Loading…
Cancel
Save