login/register scroll
This commit is contained in:
parent
aa17542f98
commit
255f69ad8f
@ -25,6 +25,7 @@ android {
|
|||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
|
signingConfig signingConfigs.debug
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
|
@ -42,7 +42,7 @@ public class PostService {
|
|||||||
|
|
||||||
FirebaseFirestore db = FirebaseFirestore.getInstance();
|
FirebaseFirestore db = FirebaseFirestore.getInstance();
|
||||||
try {
|
try {
|
||||||
for (QueryDocumentSnapshot post : Tasks.await(db.collection("/post").limit(10).get())) {
|
for (QueryDocumentSnapshot post : Tasks.await(db.collection("/post").get())) {
|
||||||
DocumentSnapshot user = Tasks.await(post.getDocumentReference("user").get());
|
DocumentSnapshot user = Tasks.await(post.getDocumentReference("user").get());
|
||||||
String username = user.get("username", String.class);
|
String username = user.get("username", String.class);
|
||||||
String email = user.get("email", String.class);
|
String email = user.get("email", String.class);
|
||||||
|
@ -1,70 +1,74 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/main"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
tools:context=".activity.MainActivity">
|
|
||||||
|
|
||||||
<TextView
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/logo"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/main"
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/default_margin"
|
tools:context=".activity.MainActivity">
|
||||||
android:text="@string/app_name"
|
|
||||||
android:textSize="48sp"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<EditText
|
<TextView
|
||||||
android:id="@+id/email"
|
android:id="@+id/logo"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/default_margin"
|
android:layout_marginTop="@dimen/default_margin"
|
||||||
android:autofillHints="emailAddress"
|
android:text="@string/app_name"
|
||||||
android:ems="10"
|
android:textSize="48sp"
|
||||||
android:hint="@string/email_hint"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:inputType="textEmailAddress"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/logo" />
|
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/password"
|
android:id="@+id/email"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/default_margin"
|
android:layout_marginTop="@dimen/default_margin"
|
||||||
android:ems="10"
|
android:autofillHints="emailAddress"
|
||||||
android:inputType="textPassword"
|
android:ems="10"
|
||||||
android:autofillHints="password"
|
android:hint="@string/email_hint"
|
||||||
android:hint="@string/password_hint"
|
android:inputType="textEmailAddress"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/email" />
|
app:layout_constraintTop_toBottomOf="@+id/logo" />
|
||||||
|
|
||||||
<Button
|
<EditText
|
||||||
android:id="@+id/login"
|
android:id="@+id/password"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/default_margin"
|
android:layout_marginTop="@dimen/default_margin"
|
||||||
android:text="@string/login_btn"
|
android:ems="10"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
android:inputType="textPassword"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:autofillHints="password"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/password"
|
android:hint="@string/password_hint"
|
||||||
android:onClick="login"/>
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/email" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/register"
|
android:id="@+id/login"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/default_margin"
|
android:layout_marginTop="@dimen/default_margin"
|
||||||
android:text="@string/register_btn"
|
android:text="@string/login_btn"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/login"
|
app:layout_constraintTop_toBottomOf="@+id/password"
|
||||||
android:onClick="redirect_register"/>
|
android:onClick="login"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
android:id="@+id/register"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/default_margin"
|
||||||
|
android:onClick="redirect_register"
|
||||||
|
android:text="@string/register_btn"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/login" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</ScrollView>
|
||||||
|
@ -1,95 +1,102 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/main"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
tools:context=".activity.RegisterActivity">
|
|
||||||
|
|
||||||
<TextView
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/logo"
|
android:id="@+id/main"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/default_margin"
|
tools:context=".activity.RegisterActivity">
|
||||||
android:text="@string/register_btn"
|
|
||||||
android:textSize="48sp"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<EditText
|
<TextView
|
||||||
android:id="@+id/email"
|
android:id="@+id/logo"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/default_margin"
|
android:layout_marginTop="@dimen/default_margin"
|
||||||
android:autofillHints="emailAddress"
|
android:text="@string/register_btn"
|
||||||
android:ems="10"
|
android:textSize="48sp"
|
||||||
android:hint="@string/email_hint"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:inputType="textEmailAddress"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/logo" />
|
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/username"
|
android:id="@+id/email"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/default_margin"
|
android:layout_marginTop="@dimen/default_margin"
|
||||||
android:ems="10"
|
android:autofillHints="emailAddress"
|
||||||
android:inputType="textPersonName"
|
android:ems="10"
|
||||||
android:autofillHints="username"
|
android:hint="@string/email_hint"
|
||||||
android:hint="@string/username_hint"
|
android:inputType="textEmailAddress"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/email" />
|
app:layout_constraintTop_toBottomOf="@+id/logo" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/password"
|
android:id="@+id/username"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/default_margin"
|
android:layout_marginTop="@dimen/default_margin"
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:inputType="textPassword"
|
android:inputType="textPersonName"
|
||||||
android:autofillHints="password"
|
android:autofillHints="username"
|
||||||
android:hint="@string/password_hint"
|
android:hint="@string/username_hint"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/username" />
|
app:layout_constraintTop_toBottomOf="@+id/email" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/repeat_password"
|
android:id="@+id/password"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/default_margin"
|
android:layout_marginTop="@dimen/default_margin"
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:inputType="textPassword"
|
android:inputType="textPassword"
|
||||||
android:autofillHints="password"
|
android:autofillHints="password"
|
||||||
android:hint="@string/repeat_password_hint"
|
android:hint="@string/password_hint"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/password" />
|
app:layout_constraintTop_toBottomOf="@+id/username" />
|
||||||
|
|
||||||
<Button
|
<EditText
|
||||||
android:id="@+id/register"
|
android:id="@+id/repeat_password"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/default_margin"
|
android:layout_marginTop="@dimen/default_margin"
|
||||||
android:text="@string/register_btn"
|
android:ems="10"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
android:inputType="textPassword"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:autofillHints="password"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/repeat_password"
|
android:hint="@string/repeat_password_hint"
|
||||||
android:onClick="register"/>
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/password" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/login"
|
android:id="@+id/register"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/default_margin"
|
android:layout_marginTop="@dimen/default_margin"
|
||||||
android:text="@string/login_btn"
|
android:text="@string/register_btn"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/register"
|
app:layout_constraintTop_toBottomOf="@+id/repeat_password"
|
||||||
android:onClick="redirect_login"/>
|
android:onClick="register"/>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
<Button
|
||||||
|
android:id="@+id/login"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/default_margin"
|
||||||
|
android:text="@string/login_btn"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/register"
|
||||||
|
android:onClick="redirect_login"/>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
@ -11,16 +11,16 @@
|
|||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:hint="@string/content_hint"
|
|
||||||
android:id="@+id/content"
|
android:id="@+id/content"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
android:layout_margin="@dimen/default_margin"
|
android:layout_margin="@dimen/default_margin"
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:gravity="start|top"
|
android:gravity="start|top"
|
||||||
|
android:hint="@string/content_hint"
|
||||||
android:inputType="textMultiLine"
|
android:inputType="textMultiLine"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/send_post"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.0"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
@ -28,12 +28,11 @@
|
|||||||
android:id="@+id/send_post"
|
android:id="@+id/send_post"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/default_margin"
|
|
||||||
android:text="@string/post_btn"
|
android:text="@string/post_btn"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/content"
|
android:layout_margin="@dimen/default_margin"/>
|
||||||
/>
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
Loading…
Reference in New Issue
Block a user