冲刺3

今日完成

1.登录页面

 

代码

package com.example.chat.activities;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceManager;

import com.example.chat.R;
import com.example.chat.databinding.ActivitySignInBinding;

public class SignInActivity extends AppCompatActivity {
private ActivitySignInBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding=ActivitySignInBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
setListeners();
}
private void setListeners(){
binding.textCreateNewAccount.setOnClickListener(v ->
startActivity(new Intent(getApplicationContext(), SignUpActivity.class)));
}
}
package com.example.chat.activities;

import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.example.chat.R;
import com.example.chat.databinding.ActivitySignInBinding;
import com.example.chat.databinding.ActivitySignUpBinding;

public class SignUpActivity extends AppCompatActivity {
private ActivitySignUpBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding=ActivitySignUpBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
setListeners();
}

private void setListeners(){
binding.textSignIn.setOnClickListener(v ->onBackPressed());
}
}
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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"
android:clipToPadding="false"
android:overScrollMode="never"
android:padding="@dimen/_24sdp"
android:scrollbars="none"
tools:context=".activities.SignInActivity"
android:background="@drawable/pic_2">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_40sdp"
android:text="@string/welcome_back"
android:textColor="@color/primary_text"
android:textSize="@dimen/_18ssp"
android:textStyle="bold"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_4sdp"
android:text="@string/login_to_continue"
android:textColor="@color/secondary_text"
android:textSize="@dimen/_12ssp"
android:textStyle="bold"/>

<EditText
android:id="@+id/inputEmail"
android:layout_width="match_parent"
android:layout_height="@dimen/_45sdp"
android:layout_marginTop="@dimen/_40sdp"
android:background="@drawable/background_input"
android:hint="@string/email"
android:imeOptions="actionNext"
android:importantForAutofill="no"
android:inputType="textEmailAddress"
android:paddingStart="@dimen/_16sdp"
android:paddingEnd="@dimen/_16sdp"
android:textColor="@color/primary_text"
android:textSize="@dimen/_13ssp"/>

<EditText
android:id="@+id/inputPassword"
android:layout_width="match_parent"
android:layout_height="@dimen/_45sdp"
android:layout_marginTop="@dimen/_16sdp"
android:background="@drawable/background_input"
android:hint="@string/password"
android:imeOptions="actionDone"
android:importantForAutofill="no"
android:inputType="textPassword"
android:paddingStart="@dimen/_16sdp"
android:paddingEnd="@dimen/_16sdp"
android:textColor="@color/primary_text"
android:textSize="@dimen/_13ssp"/>

<com.google.android.material.button.MaterialButton
android:id="@+id/buttonSignIn"
android:layout_width="match_parent"
android:layout_height="@dimen/_50sdp"
android:layout_marginTop="@dimen/_50sdp"
android:text="@string/sign_in"
android:textColor="@color/white"
android:textSize="@dimen/_13ssp"
android:textStyle="bold"
app:cornerRadius="@dimen/_8sdp" />

<TextView
android:id="@+id/textCreateNewAccount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_30sdp"
android:text="@string/create_new_account"
android:textColor="@color/primary"
android:textSize="@dimen/_13ssp"
android:textStyle="bold"/>
</LinearLayout>

</ScrollView>
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:overScrollMode="never"
android:padding="@dimen/_24sdp"
android:scrollbars="none"
tools:context=".activities.SignUpActivity"
android:background="@drawable/pic_4">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_20sdp"
android:text="@string/create_new_account"
android:textColor="@color/primary_text"
android:textSize="@dimen/_18ssp"
android:textStyle="bold"/>

<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_20sdp">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/imageProfile"
android:layout_width="@dimen/_80sdp"
android:layout_height="@dimen/_80sdp"
android:background="@drawable/background_image"
android:scaleType="centerCrop"
app:riv_oval="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/add_image"
android:textColor="@color/secondary_text"
android:textSize="@dimen/_10ssp"/>
</FrameLayout>
<EditText
android:id="@+id/inputName"
android:layout_width="match_parent"
android:layout_height="@dimen/_45sdp"
android:layout_marginTop="@dimen/_20sdp"
android:background="@drawable/background_input"
android:hint="@string/name"
android:imeOptions="actionNext"
android:importantForAutofill="no"
android:inputType="text"
android:paddingStart="@dimen/_16sdp"
android:paddingEnd="@dimen/_16sdp"
android:textColor="@color/primary_text"
android:textSize="@dimen/_13ssp"/>

<EditText
android:id="@+id/inputEmail"
android:layout_width="match_parent"
android:layout_height="@dimen/_45sdp"
android:layout_marginTop="@dimen/_16sdp"
android:background="@drawable/background_input"
android:hint="@string/email"
android:imeOptions="actionNext"
android:importantForAutofill="no"
android:inputType="textEmailAddress"
android:paddingStart="@dimen/_16sdp"
android:paddingEnd="@dimen/_16sdp"
android:textColor="@color/primary_text"
android:textSize="@dimen/_13ssp"/>


<EditText
android:id="@+id/inputPassword"
android:layout_width="match_parent"
android:layout_height="@dimen/_45sdp"
android:layout_marginTop="@dimen/_16sdp"
android:background="@drawable/background_input"
android:hint="@string/password"
android:imeOptions="actionNext"
android:importantForAutofill="no"
android:inputType="textPassword"
android:paddingStart="@dimen/_16sdp"
android:paddingEnd="@dimen/_16sdp"
android:textColor="@color/primary_text"
android:textSize="@dimen/_13ssp"/>


<EditText
android:id="@+id/inputConfirmPassword"
android:layout_width="match_parent"
android:layout_height="@dimen/_45sdp"
android:layout_marginTop="@dimen/_16sdp"
android:background="@drawable/background_input"
android:hint="@string/confirm_password"
android:imeOptions="actionDone"
android:importantForAutofill="no"
android:inputType="textPassword"
android:paddingStart="@dimen/_16sdp"
android:paddingEnd="@dimen/_16sdp"
android:textColor="@color/primary_text"
android:textSize="@dimen/_13ssp"/>

<com.google.android.material.button.MaterialButton
android:id="@+id/buttonSignUp"
android:layout_width="match_parent"
android:layout_height="@dimen/_50sdp"
android:layout_marginTop="@dimen/_16sdp"
android:text="@string/sign_up"
android:textColor="@color/white"
android:textSize="@dimen/_13ssp"
android:textStyle="bold"
app:cornerRadius="@dimen/_8sdp" />

<TextView
android:id="@+id/textSignIn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_10sdp"
android:text="@string/sign_in"
android:textColor="@color/primary"
android:textSize="@dimen/_13ssp"
android:textStyle="bold"/>


</LinearLayout>
</ScrollView>

 

posted @ 2024-06-05 22:37  chrisrmas、  阅读(3)  评论(0编辑  收藏  举报