性别称呼界面,地区选择界面

This commit is contained in:
fl_shy 2024-06-05 21:37:51 +08:00
parent 73ff2131e8
commit 0b41126fff
14 changed files with 398 additions and 5 deletions

View File

@ -8,6 +8,15 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MyApplication">
<activity
android:name=".RegionActivity"
android:exported="false" />
<activity
android:name=".Gender_NameActivity"
android:exported="false" />
<activity
android:name=".Gender_Name_Activity"
android:exported="false" />
<activity
android:name=".CaptchaActivity"
android:exported="false" />

View File

@ -2,9 +2,11 @@ package com.hnucm.weather;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.EditText;
public class CaptchaActivity extends AppCompatActivity {
@ -61,5 +63,19 @@ public class CaptchaActivity extends AppCompatActivity {
public void afterTextChanged(Editable s) {
}
});
findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(CaptchaActivity.this,Gender_NameActivity.class);
startActivity(intent);
}
});
findViewById(R.id.imageView5).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(CaptchaActivity.this,LoginActivity.class);
startActivity(intent);
}
});
}
}

View File

@ -0,0 +1,52 @@
package com.hnucm.weather;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
public class Gender_NameActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gender_name);
CheckBox checkBox1 = findViewById(R.id.checkBox1);
CheckBox checkBox2 = findViewById(R.id.checkBox2);
checkBox1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
checkBox2.setChecked(false); // 另一个框消失
}
}
});
checkBox2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
checkBox1.setChecked(false); // 另一个框消失
}
}
});
findViewById(R.id.imageView6).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Gender_NameActivity.this,CaptchaActivity.class);
startActivity(intent);
}
});
findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Gender_NameActivity.this,RegionActivity.class);
startActivity(intent);
}
});
}
}

View File

@ -0,0 +1,23 @@
package com.hnucm.weather;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class RegionActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_region);
findViewById(R.id.imageView7).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(RegionActivity.this,Gender_NameActivity.class);
startActivity(intent);
}
});
}
}

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置填充颜色为白色 -->
<solid android:color="#FFFFFF" />
<!-- 设置边框颜色和宽度 -->
<stroke android:width="2dp" android:color="#000000" />
<!-- 设置圆角半径 -->
<corners android:radius="20dp" />
</shape>

View File

@ -0,0 +1,15 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
<shape android:shape="oval">
<solid android:color="#b77b88"/>
<size android:width="48dp" android:height="48dp"/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#FFFFFF"/>
<stroke android:color="#b77b88" android:width="2dp"/>
<size android:width="120dp" android:height="120dp"/>
</shape>
</item>
</selector>

View File

@ -0,0 +1,15 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
<shape android:shape="oval">
<solid android:color="#ADD8E6"/>
<size android:width="48dp" android:height="48dp"/>
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#FFFFFF"/>
<stroke android:color="#ADD8E6" android:width="2dp"/>
<size android:width="120dp" android:height="120dp"/>
</shape>
</item>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

View File

@ -9,10 +9,10 @@
<ImageView
android:id="@+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginEnd="380dp"
android:layout_width="57dp"
android:layout_height="33dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="360dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

View File

@ -0,0 +1,135 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Gender_NameActivity"
android:background="#ecf8ff">
<ImageView
android:id="@+id/imageView6"
android:layout_width="57dp"
android:layout_height="33dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="360dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/test5" />
<TextView
android:id="@+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="80dp"
android:layout_marginEnd="200dp"
android:text="您的选择是:"
android:textSize="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="您的称呼是:"
android:textSize="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/textView10"
app:layout_constraintStart_toStartOf="@+id/textView10"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/button"
android:layout_width="240dp"
android:layout_height="50dp"
android:layout_marginTop="20dp"
android:backgroundTint="#003A8C"
android:shadowColor="#003A8C"
android:text="确定"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/et_nickname" />
<EditText
android:id="@+id/et_nickname"
android:layout_width="240dp"
android:layout_height="40dp"
android:layout_marginTop="420dp"
android:background="@drawable/edittext_rounded_background"
android:gravity="center"
android:hint="请输入您的昵称"
android:inputType="text"
android:padding="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="100dp"
android:text="跳过"
android:textSize="18dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center">
</RadioGroup>
<RadioButton
android:id="@+id/radio_male"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="-150dp"
android:layout_marginTop="140dp"
android:background="@drawable/radio_button_male_selector"
android:button="@android:color/transparent"
android:gravity="center"
android:padding="10dp"
android:text="男"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<RadioButton
android:id="@+id/radio_female"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="140dp"
android:layout_marginEnd="-150dp"
android:background="@drawable/radio_button_female_selector"
android:button="@android:color/transparent"
android:gravity="center"
android:padding="10dp"
android:text="女"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<CheckBox
android:id="@+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="@+id/radio_male"
app:layout_constraintStart_toStartOf="@+id/radio_male"
app:layout_constraintTop_toBottomOf="@+id/radio_male" />
<CheckBox
android:id="@+id/checkBox2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="@+id/radio_female"
app:layout_constraintStart_toStartOf="@+id/radio_female"
app:layout_constraintTop_toBottomOf="@+id/radio_female" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -35,7 +35,7 @@
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="81dp"
android:layout_marginBottom="120dp"
android:text="— 第三方登录 —"
android:textColor="#000000"
app:layout_constraintBottom_toBottomOf="parent"
@ -73,4 +73,26 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView2" />
<ImageView
android:id="@+id/imageView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="-70dp"
android:layout_marginBottom="64dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/test6" />
<ImageView
android:id="@+id/imageView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="-70dp"
android:layout_marginBottom="64dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/test7" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,97 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".RegionActivity"
android:background="#b3e2ff">
<ImageView
android:id="@+id/imageView7"
android:layout_width="57dp"
android:layout_height="33dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="360dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/test5" />
<TextView
android:id="@+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="80dp"
android:layout_marginEnd="160dp"
android:text="您的所在地区是:"
android:textSize="25dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="@+id/et_nickname"
android:layout_width="240dp"
android:layout_height="40dp"
android:layout_marginTop="160dp"
android:background="@drawable/edittext_rounded_background"
android:gravity="center"
android:hint="当前定位城市"
android:inputType="text"
android:padding="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView14"
android:layout_width="35dp"
android:layout_height="20dp"
android:layout_marginTop="16dp"
android:text="OR"
app:layout_constraintEnd_toEndOf="@+id/et_nickname"
app:layout_constraintStart_toStartOf="@+id/et_nickname"
app:layout_constraintTop_toBottomOf="@+id/et_nickname" />
<EditText
android:id="@+id/et_nickname1"
android:layout_width="240dp"
android:layout_height="40dp"
android:layout_marginTop="48dp"
android:background="@drawable/edittext_rounded_background"
android:gravity="center"
android:hint="xxx.xxx.xxx."
android:inputType="text"
android:padding="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/et_nickname" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="-150dp"
android:layout_marginTop="32dp"
android:backgroundTint="@color/black"
android:text="确定"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginEnd="-150dp"
android:backgroundTint="@color/white"
android:text="跳过"
android:textColor="@color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>