From 78586f630ac8c7d59d0cdf7cbf1f7f2da6ae50d5 Mon Sep 17 00:00:00 2001 From: Ank <1165031857@qq.com> Date: Sun, 18 Jul 2021 21:01:11 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=BD=AD=E5=AE=89=E5=BA=B7=E7=9A=84?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pak.c | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 pak.c diff --git a/pak.c b/pak.c new file mode 100644 index 0000000..97db565 --- /dev/null +++ b/pak.c @@ -0,0 +1,6 @@ +#include +int main() +{ + printf("hello world"); + return 0; +} \ No newline at end of file From e61c2d5439f55c3905bb0ebf54d97279dea1831a Mon Sep 17 00:00:00 2001 From: lyb18758 <1204490597@qq.com> Date: Mon, 19 Jul 2021 14:43:07 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lyb.c | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 lyb.c diff --git a/lyb.c b/lyb.c new file mode 100644 index 0000000..9fdbcea --- /dev/null +++ b/lyb.c @@ -0,0 +1,6 @@ +#include +int main() +{ +printf("test!"); +return 0; +} \ No newline at end of file From 395dc7dd78d22c69d59ea24702d1cc76a771c704 Mon Sep 17 00:00:00 2001 From: lyb18758 <1204490597@qq.com> Date: Mon, 19 Jul 2021 16:08:33 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E6=AC=A1=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lyb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lyb.c b/lyb.c index 9fdbcea..a182b30 100644 --- a/lyb.c +++ b/lyb.c @@ -1,6 +1,6 @@ #include int main() { -printf("test!"); +printf(" second test!"); return 0; } \ No newline at end of file From 3386fec8b0e2b0a7c7b2c32785e9c88b4658e91b Mon Sep 17 00:00:00 2001 From: lyb18758 <1204490597@qq.com> Date: Sat, 21 Aug 2021 00:38:22 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=92=8C=E6=B3=A8?= =?UTF-8?q?=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 登录和注册界面,sdk运行版本30.0.2,sqlite中已有用户名lyb 密码123456 --- login/.gitignore | 15 ++ login/.idea/.gitignore | 3 + login/.idea/compiler.xml | 6 + login/.idea/gradle.xml | 20 ++ login/.idea/jarRepositories.xml | 30 +++ login/.idea/misc.xml | 9 + login/.idea/runConfigurations.xml | 10 + login/app/.gitignore | 1 + login/app/build.gradle | 39 ++++ login/app/proguard-rules.pro | 21 +++ .../login/ExampleInstrumentedTest.java | 26 +++ login/app/src/main/AndroidManifest.xml | 23 +++ .../src/main/java/com/example/login/Code.java | 148 +++++++++++++++ .../java/com/example/login/DBOpenHelper.java | 61 ++++++ .../java/com/example/login/LoginActivity.java | 88 +++++++++ .../java/com/example/login/MainActivity.java | 33 ++++ .../com/example/login/RegisterActivity.java | 95 ++++++++++ .../src/main/java/com/example/login/User.java | 29 +++ .../drawable-v24/ic_launcher_foreground.xml | 30 +++ .../res/drawable/ic_launcher_background.xml | 170 +++++++++++++++++ .../src/main/res/drawable/ic_left_back.png | Bin 0 -> 388 bytes .../selector_loginactivity_button.xml | 26 +++ .../src/main/res/layout/activity_login.xml | 149 +++++++++++++++ .../app/src/main/res/layout/activity_main.xml | 34 ++++ .../src/main/res/layout/activity_register.xml | 173 ++++++++++++++++++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3593 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 5339 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2636 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 3388 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4926 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 7472 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 7909 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 11873 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 10652 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 16570 bytes .../app/src/main/res/values-night/themes.xml | 16 ++ login/app/src/main/res/values/colors.xml | 14 ++ login/app/src/main/res/values/strings.xml | 3 + login/app/src/main/res/values/themes.xml | 16 ++ .../com/example/login/ExampleUnitTest.java | 17 ++ login/build.gradle | 25 +++ login/gradle.properties | 17 ++ login/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 54329 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 + login/gradlew | 172 +++++++++++++++++ login/gradlew.bat | 84 +++++++++ login/settings.gradle | 2 + 49 files changed, 1621 insertions(+) create mode 100644 login/.gitignore create mode 100644 login/.idea/.gitignore create mode 100644 login/.idea/compiler.xml create mode 100644 login/.idea/gradle.xml create mode 100644 login/.idea/jarRepositories.xml create mode 100644 login/.idea/misc.xml create mode 100644 login/.idea/runConfigurations.xml create mode 100644 login/app/.gitignore create mode 100644 login/app/build.gradle create mode 100644 login/app/proguard-rules.pro create mode 100644 login/app/src/androidTest/java/com/example/login/ExampleInstrumentedTest.java create mode 100644 login/app/src/main/AndroidManifest.xml create mode 100644 login/app/src/main/java/com/example/login/Code.java create mode 100644 login/app/src/main/java/com/example/login/DBOpenHelper.java create mode 100644 login/app/src/main/java/com/example/login/LoginActivity.java create mode 100644 login/app/src/main/java/com/example/login/MainActivity.java create mode 100644 login/app/src/main/java/com/example/login/RegisterActivity.java create mode 100644 login/app/src/main/java/com/example/login/User.java create mode 100644 login/app/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 login/app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 login/app/src/main/res/drawable/ic_left_back.png create mode 100644 login/app/src/main/res/drawable/selector_loginactivity_button.xml create mode 100644 login/app/src/main/res/layout/activity_login.xml create mode 100644 login/app/src/main/res/layout/activity_main.xml create mode 100644 login/app/src/main/res/layout/activity_register.xml create mode 100644 login/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 login/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 login/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 login/app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 login/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 login/app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 login/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 login/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 login/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 login/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 login/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 login/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 login/app/src/main/res/values-night/themes.xml create mode 100644 login/app/src/main/res/values/colors.xml create mode 100644 login/app/src/main/res/values/strings.xml create mode 100644 login/app/src/main/res/values/themes.xml create mode 100644 login/app/src/test/java/com/example/login/ExampleUnitTest.java create mode 100644 login/build.gradle create mode 100644 login/gradle.properties create mode 100644 login/gradle/wrapper/gradle-wrapper.jar create mode 100644 login/gradle/wrapper/gradle-wrapper.properties create mode 100644 login/gradlew create mode 100644 login/gradlew.bat create mode 100644 login/settings.gradle diff --git a/login/.gitignore b/login/.gitignore new file mode 100644 index 0000000..643d213 --- /dev/null +++ b/login/.gitignore @@ -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 diff --git a/login/.idea/.gitignore b/login/.idea/.gitignore new file mode 100644 index 0000000..eaf91e2 --- /dev/null +++ b/login/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/login/.idea/compiler.xml b/login/.idea/compiler.xml new file mode 100644 index 0000000..245a82c --- /dev/null +++ b/login/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/login/.idea/gradle.xml b/login/.idea/gradle.xml new file mode 100644 index 0000000..78708b3 --- /dev/null +++ b/login/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/login/.idea/jarRepositories.xml b/login/.idea/jarRepositories.xml new file mode 100644 index 0000000..94ae73a --- /dev/null +++ b/login/.idea/jarRepositories.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/login/.idea/misc.xml b/login/.idea/misc.xml new file mode 100644 index 0000000..2925c96 --- /dev/null +++ b/login/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/login/.idea/runConfigurations.xml b/login/.idea/runConfigurations.xml new file mode 100644 index 0000000..93e4b17 --- /dev/null +++ b/login/.idea/runConfigurations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/login/app/.gitignore b/login/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/login/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/login/app/build.gradle b/login/app/build.gradle new file mode 100644 index 0000000..42e97fc --- /dev/null +++ b/login/app/build.gradle @@ -0,0 +1,39 @@ +plugins { + id 'com.android.application' +} + +android { + compileSdkVersion 30 + buildToolsVersion "30.0.2" + + defaultConfig { + applicationId "com.example.login" + minSdkVersion 21 + targetSdkVersion 30 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled 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.2.0' + implementation 'com.google.android.material:material:1.2.1' + implementation 'androidx.constraintlayout:constraintlayout:2.0.1' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' +} \ No newline at end of file diff --git a/login/app/proguard-rules.pro b/login/app/proguard-rules.pro new file mode 100644 index 0000000..64b4a05 --- /dev/null +++ b/login/app/proguard-rules.pro @@ -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 \ No newline at end of file diff --git a/login/app/src/androidTest/java/com/example/login/ExampleInstrumentedTest.java b/login/app/src/androidTest/java/com/example/login/ExampleInstrumentedTest.java new file mode 100644 index 0000000..ef33c4c --- /dev/null +++ b/login/app/src/androidTest/java/com/example/login/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.login; + +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 Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.example.login", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/login/app/src/main/AndroidManifest.xml b/login/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f4c4344 --- /dev/null +++ b/login/app/src/main/AndroidManifest.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/login/app/src/main/java/com/example/login/Code.java b/login/app/src/main/java/com/example/login/Code.java new file mode 100644 index 0000000..1205603 --- /dev/null +++ b/login/app/src/main/java/com/example/login/Code.java @@ -0,0 +1,148 @@ +package com.example.login; + +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; + +import java.util.Random; + +/** + * Created by littlecurl 2018/6/24 + */ + +public class Code { + /** + * 随机数数组 + * 去除了易混淆的 数字 0 和 字母 o O + * 数字 1 和 字母 i I l L + * 数字 6 和 字母 b + * 数字 9 和 字母 q + * 字母 c C 和 G + * 字母 t (经常和随机线混在一起看不清) + */ + private static final char[] CHARS = { + '2', '3', '4', '5', '7', '8', + 'a', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'm', + 'n', 'p', 'r', 's', 'u', 'v', 'w', 'x', 'y', 'z', + 'A', 'B', 'D', 'E', 'F', 'H', 'J', 'K', 'M', + 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' + }; + + private static Code bmpCode; + + public static Code getInstance() { + if(bmpCode == null) + bmpCode = new Code(); + return bmpCode; + } + + //default settings + //验证码默认随机数的个数 + private static final int DEFAULT_CODE_LENGTH = 4; + //默认字体大小 + private static final int DEFAULT_FONT_SIZE = 25; + //默认线条的条数 + private static final int DEFAULT_LINE_NUMBER = 5; + //padding值 + private static final int BASE_PADDING_LEFT = 10, RANGE_PADDING_LEFT = 15, BASE_PADDING_TOP = 15, RANGE_PADDING_TOP = 20; + //验证码的默认宽高 + private static final int DEFAULT_WIDTH = 100, DEFAULT_HEIGHT = 40; + + //settings decided by the layout xml + //canvas width and height + private int width = DEFAULT_WIDTH, height = DEFAULT_HEIGHT; + + //random word space and pading_top + private int base_padding_left = BASE_PADDING_LEFT, range_padding_left = RANGE_PADDING_LEFT, + base_padding_top = BASE_PADDING_TOP, range_padding_top = RANGE_PADDING_TOP; + + //number of chars, lines; font size + private int codeLength = DEFAULT_CODE_LENGTH, line_number = DEFAULT_LINE_NUMBER, font_size = DEFAULT_FONT_SIZE; + + //variables + private String code; + private int padding_left, padding_top; + private Random random = new Random(); + //验证码图片 + public Bitmap createBitmap() { + padding_left = 0; + + Bitmap bp = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); + Canvas c = new Canvas(bp); + + code = createCode(); + + c.drawColor(Color.WHITE); + Paint paint = new Paint(); + paint.setAntiAlias(true); + paint.setTextSize(font_size); + //画验证码 + for (int i = 0; i < code.length(); i++) { + randomTextStyle(paint); + randomPadding(); + c.drawText(code.charAt(i) + "", padding_left, padding_top, paint); + } + //画线条 + for (int i = 0; i < line_number; i++) { + drawLine(c, paint); + } + +// c.save( Canvas.ALL_SAVE_FLAG );//保存 + c.save();//保存 + c.restore();// + return bp; + } + + public String getCode() { + return code; + } + + //生成验证码 + private String createCode() { + StringBuilder buffer = new StringBuilder(); + for (int i = 0; i < codeLength; i++) { + buffer.append(CHARS[random.nextInt(CHARS.length)]); + } + return buffer.toString(); + } + //画干扰线 + private void drawLine(Canvas canvas, Paint paint) { + int color = randomColor(); + int startX = random.nextInt(width); + int startY = random.nextInt(height); + int stopX = random.nextInt(width); + int stopY = random.nextInt(height); + paint.setStrokeWidth(1); + paint.setColor(color); + canvas.drawLine(startX, startY, stopX, stopY, paint); + } + //生成随机颜色 + private int randomColor() { + return randomColor(1); + } + + private int randomColor(int rate) { + int red = random.nextInt(256) / rate; + int green = random.nextInt(256) / rate; + int blue = random.nextInt(256) / rate; + return Color.rgb(red, green, blue); + } + //随机生成文字样式,颜色,粗细,倾斜度 + private void randomTextStyle(Paint paint) { + int color = randomColor(); + paint.setColor(color); + paint.setFakeBoldText(random.nextBoolean()); //true为粗体,false为非粗体 + float skewX = random.nextInt(11) / 10; + skewX = random.nextBoolean() ? skewX : -skewX; + paint.setTextSkewX(skewX); //float类型参数,负数表示右斜,整数左斜 + //paint.setUnderlineText(true); //true为下划线,false为非下划线 + //paint.setStrikeThruText(true); //true为删除线,false为非删除线 + } + //随机生成padding值 + private void randomPadding() { + padding_left += base_padding_left + random.nextInt(range_padding_left); + padding_top = base_padding_top + random.nextInt(range_padding_top); + } +} + diff --git a/login/app/src/main/java/com/example/login/DBOpenHelper.java b/login/app/src/main/java/com/example/login/DBOpenHelper.java new file mode 100644 index 0000000..e6e11d4 --- /dev/null +++ b/login/app/src/main/java/com/example/login/DBOpenHelper.java @@ -0,0 +1,61 @@ +package com.example.login; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.database.Cursor; +import android.database.sqlite.SQLiteDatabase; +import android.database.sqlite.SQLiteOpenHelper; + +import java.util.ArrayList; + +public class DBOpenHelper extends SQLiteOpenHelper { + private SQLiteDatabase db; + + static String DATABASE_NAME="User"; + static String CREATE_SQL="CREATE TABLE IF NOT EXISTS User(id integer primary key autoincrement, name text,password text)";//建表 + static String DROP_SQL="DROP TABLE IF EXISTS User"; + + public DBOpenHelper (Context context){ + super(context,DATABASE_NAME,null,1); + db=getReadableDatabase(); + } + + @Override + public void onCreate(SQLiteDatabase db) { + db.execSQL(CREATE_SQL); + + } + + @Override + public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) { + db.execSQL(DROP_SQL); + onCreate(db); + + } + //增删改查 + static private String INSERT_SQL="INSERT INTO User (name,password) VALUES(?,?)"; + static private String DELETE_SQL="DELETE FROM User WHERE name= AND password ="; + + public void add(String name,String password){ + db.execSQL(INSERT_SQL,new Object[]{name,password}); + } + public void delete(String name,String password){ + db.execSQL(DELETE_SQL+name+password); + } + public void update(String name,String password){ + db.execSQL("UPDATE User SET password = ?",new Object[]{password}); + } + + public ArrayList getAllDate(){ + + ArrayList list=new ArrayList(); + Cursor cursor=db.query("User",null,null,null,null,null,"name DESC"); + while (cursor.moveToNext()){ + @SuppressLint("Range") String name=cursor.getString(cursor.getColumnIndex("name")); + @SuppressLint("Range") String password = cursor.getString(cursor.getColumnIndex("password")); + list.add(new User(name,password)); + + } + return list; + } +} diff --git a/login/app/src/main/java/com/example/login/LoginActivity.java b/login/app/src/main/java/com/example/login/LoginActivity.java new file mode 100644 index 0000000..8d32c08 --- /dev/null +++ b/login/app/src/main/java/com/example/login/LoginActivity.java @@ -0,0 +1,88 @@ +package com.example.login; + +import androidx.appcompat.app.AppCompatActivity; + +import android.content.Intent; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import java.util.ArrayList; + +public class LoginActivity extends AppCompatActivity implements View.OnClickListener{ + + private DBOpenHelper mDBOpenHelper; + private TextView mTvLoginactivityRegister; + private RelativeLayout mRlLoginactivityTop; + private EditText mEtLoginactivityUsername; + private EditText mEtLoginactivityPassword; + private LinearLayout mLlLoginactivityTwo; + private Button mBtLoginactivityLogin; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_login); + + initView(); + + mDBOpenHelper=new DBOpenHelper(this); + } + + + private void initView(){ + mBtLoginactivityLogin = findViewById(R.id.bt_loginactivity_login); + mTvLoginactivityRegister = findViewById(R.id.tv_loginactivity_register); + mRlLoginactivityTop = findViewById(R.id.rl_loginactivity_top); + mEtLoginactivityUsername = findViewById(R.id.et_loginactivity_username); + mEtLoginactivityPassword = findViewById(R.id.et_loginactivity_password); + mLlLoginactivityTwo = findViewById(R.id.ll_loginactivity_two); +//设置监听事件 + mBtLoginactivityLogin.setOnClickListener(this); + mTvLoginactivityRegister.setOnClickListener(this); + } + + public void onClick(View view){ + switch (view.getId()){ + + case R.id.tv_loginactivity_register: + startActivity(new Intent(this,RegisterActivity.class)); + finish(); + break; + case R.id.bt_loginactivity_login: + String name=mEtLoginactivityUsername.getText().toString().trim(); + String password=mEtLoginactivityPassword.getText().toString().trim(); + if(!TextUtils.isEmpty(name)&&!TextUtils.isEmpty(password)){ + ArrayList data=mDBOpenHelper.getAllDate(); + boolean match=false; + for(int i=0;i + + + + + + + + + + \ No newline at end of file diff --git a/login/app/src/main/res/drawable/ic_launcher_background.xml b/login/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..a4f78de --- /dev/null +++ b/login/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/login/app/src/main/res/drawable/ic_left_back.png b/login/app/src/main/res/drawable/ic_left_back.png new file mode 100644 index 0000000000000000000000000000000000000000..ddf2de180c80d860f3d452e94c7780bd99863019 GIT binary patch literal 388 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k3?#4J%UA`Zk^_7~T!Hj|8iQG`ybFNVD3%2I z1v4-*F}K(M?_l}9wP6G6Cbo^g*ysNK)>_q6*I3T+?*o6Qr^5DYK*j4lT^vI!PG6mT zR;bBp!ALEaFulHg;obh$SlNHvsUq1M5yJ^BuuTa7ldg846y2pwv4!xQk zi##57%`}~=5O78%ZBmdKI;Vst0L94O3jhEB literal 0 HcmV?d00001 diff --git a/login/app/src/main/res/drawable/selector_loginactivity_button.xml b/login/app/src/main/res/drawable/selector_loginactivity_button.xml new file mode 100644 index 0000000..6f4c918 --- /dev/null +++ b/login/app/src/main/res/drawable/selector_loginactivity_button.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/login/app/src/main/res/layout/activity_login.xml b/login/app/src/main/res/layout/activity_login.xml new file mode 100644 index 0000000..1bae927 --- /dev/null +++ b/login/app/src/main/res/layout/activity_login.xml @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + +