田子悦 2 months ago
parent 391c5f1410
commit 6177143582

BIN
.DS_Store vendored

Binary file not shown.

Binary file not shown.

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">

@ -30,6 +30,9 @@
<activity <activity
android:name=".HeightSelectionActivity" android:name=".HeightSelectionActivity"
android:exported="false" /> android:exported="false" />
<activity
android:name=".LoginActivity"
android:exported="false" />
</application> </application>
</manifest> </manifest>

@ -84,7 +84,7 @@ class HeightSelectionActivity : AppCompatActivity() {
private fun setupClickListeners() { private fun setupClickListeners() {
nextButton.setOnClickListener { nextButton.setOnClickListener {
val intent = Intent(this, MainActivity::class.java) val intent = Intent(this, LoginActivity::class.java)
intent.putExtra("selected_gender", selectedGender) intent.putExtra("selected_gender", selectedGender)
intent.putExtra("selected_age", selectedAge) intent.putExtra("selected_age", selectedAge)
intent.putExtra("selected_weight", selectedWeight) intent.putExtra("selected_weight", selectedWeight)

@ -0,0 +1,60 @@
package org.tensorflow.lite.examples.poseestimation
import android.content.Intent
import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.textfield.TextInputEditText
import android.widget.Button
import android.widget.TextView
import android.widget.EditText
class LoginActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_login)
// 获取从上一个页面传递的数据
val selectedGender = intent.getStringExtra("selected_gender")
val selectedAge = intent.getIntExtra("selected_age", 0)
val selectedWeight = intent.getIntExtra("selected_weight", 0)
val selectedHeight = intent.getIntExtra("selected_height", 0)
// 绑定控件
val emailEdit = findViewById<EditText>(R.id.editEmail)
val passwordEdit = findViewById<EditText>(R.id.editPassword)
val loginBtn = findViewById<Button>(R.id.btnLogin)
val forgotPassword = findViewById<TextView>(R.id.forgotPassword)
// 登录按钮点击事件
loginBtn.setOnClickListener {
val email = emailEdit.text.toString().trim()
val password = passwordEdit.text.toString().trim()
// 表单验证
if (email.isEmpty()) {
emailEdit.error = "请输入邮箱"
return@setOnClickListener
}
if (password.isEmpty()) {
passwordEdit.error = "请输入密码"
return@setOnClickListener
}
// TODO: 这里添加实际的登录验证逻辑
// 目前仅做演示,直接跳转到主页面
val intent = Intent(this, MainActivity::class.java)
intent.putExtra("selected_gender", selectedGender)
intent.putExtra("selected_age", selectedAge)
intent.putExtra("selected_weight", selectedWeight)
intent.putExtra("selected_height", selectedHeight)
startActivity(intent)
finish()
}
// 忘记密码点击事件
forgotPassword.setOnClickListener {
Toast.makeText(this, "忘记密码功能开发中", Toast.LENGTH_SHORT).show()
}
}
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="#B266FF" android:state_focused="true"/>
<item android:color="#FFFFFF"/>
</selector>

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 882 KiB

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@android:color/black"> android:background="@color/black">
<TextView <TextView
android:id="@+id/titleText" android:id="@+id/titleText"

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@android:color/black"> android:background="@color/black">
<TextView <TextView
android:id="@+id/titleText" android:id="@+id/titleText"

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@android:color/black"> android:background="@color/black">
<!-- 标题 --> <!-- 标题 -->
<TextView <TextView

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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="match_parent"
android:background="#19191B">
<!-- 背景大图 -->
<ImageView
android:id="@+id/bgImage"
android:layout_width="match_parent"
android:layout_height="0dp"
android:scaleType="centerCrop"
android:src="@drawable/login_woman"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintDimensionRatio="417:515"
app:layout_constraintWidth_default="percent"
app:layout_constraintWidth_percent="1.0"/>
<!-- 顶部Tab切换栏 -->
<LinearLayout
android:id="@+id/tabBar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingStart="32dp"
android:paddingTop="48dp"
android:paddingEnd="32dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/tabLogin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Login"
android:textColor="#FFF"
android:textSize="18sp"
android:textStyle="bold"/>
<View
android:layout_width="32dp"
android:layout_height="2dp"
android:background="#BF5AF2"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
<Space
android:layout_width="24dp"
android:layout_height="1dp"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/tabSignup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sign up"
android:textColor="#99FFFFFF"
android:textSize="18sp"/>
<View
android:layout_width="32dp"
android:layout_height="2dp"
android:background="@android:color/transparent"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
</LinearLayout>
<!-- 下半部分遮罩和表单 -->
<androidx.cardview.widget.CardView
android:id="@+id/formCard"
android:layout_width="0dp"
android:layout_height="0dp"
app:cardCornerRadius="32dp"
app:cardBackgroundColor="#19191B"
app:layout_constraintTop_toBottomOf="@id/bgImage"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="24dp">
<!-- 用户名输入框 -->
<EditText
android:id="@+id/editEmail"
android:layout_width="match_parent"
android:layout_height="60dp"
android:hint="用户名"
android:textColor="#FFFFFF"
android:textColorHint="#FFFFFF"
android:background="@android:color/transparent"
android:inputType="text"
android:layout_marginBottom="16dp"/>
<!-- 密码输入框 -->
<EditText
android:id="@+id/editPassword"
android:layout_width="match_parent"
android:layout_height="60dp"
android:hint="密码"
android:textColor="#FFFFFF"
android:textColorHint="#FFFFFF"
android:background="@android:color/transparent"
android:inputType="textPassword"/>
<!-- 忘记密码 -->
<TextView
android:id="@+id/forgotPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Forgot Password"
android:textColor="#BF5AF2"
android:textSize="14sp"
android:layout_gravity="end"
android:layout_marginTop="8dp"/>
<!-- 主按钮 -->
<Button
android:id="@+id/btnLogin"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="Login"
android:textColor="#FFF"
android:textSize="18sp"
android:layout_marginTop="32dp"
android:background="@drawable/btn_purple_rounded"
android:stateListAnimator="@null"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@android:color/black"> android:background="@color/black">
<!-- 标题 --> <!-- 标题 -->
<TextView <TextView

@ -4,7 +4,7 @@
<color name="purple_700">#FF3700B3</color> <color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color> <color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color> <color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color> <color name="black">#1C1C1E</color>
<color name="white">#FFFFFFFF</color> <color name="white">#FFFFFFFF</color>
<color name="gray">#757575</color> <color name="gray">#757575</color>
<color name="gray_light">#E0E0E0</color> <color name="gray_light">#E0E0E0</color>

@ -14,6 +14,7 @@
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
<item name="android:textColor">@color/black</item> <item name="android:textColor">@color/black</item>
<item name="android:textSize">16sp</item> <item name="android:textSize">16sp</item>
<item name="android:textColorHint">#FFFFFF</item>
</style> </style>
<style name="NumberPickerStyle"> <style name="NumberPickerStyle">
<item name="android:textSize">40sp</item> <item name="android:textSize">40sp</item>

Loading…
Cancel
Save