Skip to content

Commit

Permalink
用户手册/隐私手册 更新
Browse files Browse the repository at this point in the history
  • Loading branch information
WildFox404 committed Aug 1, 2024
1 parent fae8d41 commit 87f860f
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 11 deletions.
Binary file modified .gradle/8.0/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/8.0/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/8.0/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/8.0/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/8.0/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
58 changes: 57 additions & 1 deletion app/src/main/java/com/example/newapp/LoginActivity.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package com.example.newapp;

import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.*;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import com.example.newapp.entries.User;
import com.example.newapp.navigation.BottomNavigationViewActivity;
Expand All @@ -27,6 +30,59 @@ protected void onCreate(Bundle savedInstanceState) {
// 初始化 SharedPreferences
sharedPreferences = getSharedPreferences("MyPrefs", Context.MODE_PRIVATE);
EditText eduUserName =findViewById(R.id.editTextAccount);
TextView privacy_manual =findViewById(R.id.privacy_manual);
TextView user_manual =findViewById(R.id.user_manual);

privacy_manual.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);
builder.setTitle("隐私手册"); // 设置对话框标题
builder.setMessage("本项目在GitHub上开源\n" +
"代码公开,保证用户隐私安全\n" +
"认准作者渠道,防止安装他人修改版本"); // 设置对话框内容
// 设置取消按钮及其点击事件(可选)
builder.setNegativeButton("确认", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// 用户点击取消按钮后的处理逻辑,可以留空如果不需要额外处理
dialog.dismiss(); // 关闭对话框
}
});

// 创建自定义的背景Drawable
Drawable drawable = getResources().getDrawable(R.drawable.selectbutton3);
// 创建并显示对话框
AlertDialog dialog = builder.create();
dialog.getWindow().setBackgroundDrawable(drawable);
dialog.show();
}
});
user_manual.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);
builder.setTitle("用户手册"); // 设置对话框标题
builder.setMessage("处于初级阶段\n" +
"许多功能需要完善/可能有bug\n" +
"欢迎反馈,QQ群:956026820"); // 设置对话框内容
// 设置取消按钮及其点击事件(可选)
builder.setNegativeButton("确认", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// 用户点击取消按钮后的处理逻辑,可以留空如果不需要额外处理
dialog.dismiss(); // 关闭对话框
}
});

// 创建自定义的背景Drawable
Drawable drawable = getResources().getDrawable(R.drawable.selectbutton3);
// 创建并显示对话框
AlertDialog dialog = builder.create();
dialog.getWindow().setBackgroundDrawable(drawable);
dialog.show();
}
});
eduUserName.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
Expand Down Expand Up @@ -56,7 +112,7 @@ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
ImageView loginView = findViewById(R.id.loginButton);

int[] buildingImages = {R.drawable.chinabuilding1, R.drawable.chinabuilding2, R.drawable.chinabuilding3,
R.drawable.chinabuilding4, R.drawable.chinabuilding5, R.drawable.chinabuilding8,
R.drawable.chinabuilding4, R.drawable.chinabuilding5, R.drawable.chinabuilding8,
R.drawable.chinabuilding9, R.drawable.chinabuilding10, R.drawable.chinabuilding11,
R.drawable.chinabuilding12};
Random rand = new Random();
Expand Down
51 changes: 41 additions & 10 deletions app/src/main/res/layout/login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,51 @@
app:layout_constraintBottom_toBottomOf="@+id/imageView14"
android:inputType="textPassword" app:layout_constraintTop_toTopOf="@+id/imageView14"/>

<TextView
<LinearLayout

android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="我已阅读 用户手册 和 隐私政策"
android:textColor="#0C0D0F"
android:textSize="15dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView14" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginTop="15dp">

android:layout_marginTop="15dp"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="我已阅读 "
android:textColor="#0C0D0F"
android:textSize="15sp">

</TextView>
</TextView>
<TextView
android:id="@+id/user_manual"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="用户手册"
android:textColor="@color/bule_white2"
android:textSize="15dp">
</TextView>
<TextView
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#0C0D0F"
android:textSize="15dp">
</TextView>
<TextView
android:id="@+id/privacy_manual"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="隐私手册"
android:textColor="@color/bule_white2"
android:textSize="15dp">
</TextView>
</LinearLayout>
<ImageView
android:id="@+id/agreementFalse"
android:visibility="visible"
Expand Down

0 comments on commit 87f860f

Please sign in to comment.