Commit d5ffd2a9 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Fixes the sign up screen (to allow the remaining views to be visible when scrolling down)

parent 7b05adba
...@@ -19,12 +19,15 @@ import javax.inject.Inject ...@@ -19,12 +19,15 @@ import javax.inject.Inject
class SignupFragment : Fragment(), SignupView { class SignupFragment : Fragment(), SignupView {
@Inject lateinit var presenter: SignupPresenter @Inject lateinit var presenter: SignupPresenter
private val layoutListener = ViewTreeObserver.OnGlobalLayoutListener { private val layoutListener = ViewTreeObserver.OnGlobalLayoutListener {
if (KeyboardHelper.isSoftKeyboardShown(constraint_layout.rootView)) { if (KeyboardHelper.isSoftKeyboardShown(relative_layout.rootView)) {
text_new_user_agreement.setVisible(false) bottom_container.setVisible(false)
} else { } else {
text_new_user_agreement.setVisible(true) bottom_container.apply {
postDelayed({
setVisible(true)
}, 3)
}
} }
} }
...@@ -48,7 +51,7 @@ class SignupFragment : Fragment(), SignupView { ...@@ -48,7 +51,7 @@ class SignupFragment : Fragment(), SignupView {
tintEditTextDrawableStart() tintEditTextDrawableStart()
} }
constraint_layout.viewTreeObserver.addOnGlobalLayoutListener(layoutListener) relative_layout.viewTreeObserver.addOnGlobalLayoutListener(layoutListener)
setUpNewUserAgreementListener() setUpNewUserAgreementListener()
...@@ -58,8 +61,8 @@ class SignupFragment : Fragment(), SignupView { ...@@ -58,8 +61,8 @@ class SignupFragment : Fragment(), SignupView {
} }
override fun onDestroyView() { override fun onDestroyView() {
relative_layout.viewTreeObserver.removeOnGlobalLayoutListener(layoutListener)
super.onDestroyView() super.onDestroyView()
constraint_layout.viewTreeObserver.removeOnGlobalLayoutListener(layoutListener)
} }
override fun alertBlankName() { override fun alertBlankName() {
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"> <set xmlns:android="http://schemas.android.com/apk/res/android">
<translate <translate
android:duration="800" android:duration="500"
android:fromYDelta="0.0%p" android:fromYDelta="0.0%p"
android:toYDelta="0.0%p" /> android:toYDelta="0.0%p" />
</set> </set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"> <set xmlns:android="http://schemas.android.com/apk/res/android">
<translate xmlns:android="http://schemas.android.com/apk/res/android" <translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="350" android:duration="250"
android:fromYDelta="100.0%" android:fromYDelta="100.0%"
android:toYDelta="0.0%" /> android:toYDelta="0.0%" />
</set> </set>
\ No newline at end of file
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
tools:context=".authentication.login.ui.LoginFragment"> tools:context=".authentication.login.ui.LoginFragment">
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
android:id="@+id/middle_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout 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/constraint_layout" android:id="@+id/relative_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:focusableInTouchMode="true"
tools:context=".authentication.signup.ui.SignupFragment"> tools:context=".authentication.signup.ui.SignupFragment">
<ScrollView
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView <TextView
android:id="@+id/text_headline" android:id="@+id/text_headline"
style="@style/Authentication.Headline.TextView" style="@style/Authentication.Headline.TextView"
android:text="@string/title_sign_up" android:layout_gravity="center"
app:layout_constraintLeft_toLeftOf="parent" android:text="@string/title_sign_up" />
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText <EditText
android:id="@+id/text_name" android:id="@+id/text_name"
...@@ -22,10 +31,7 @@ ...@@ -22,10 +31,7 @@
android:drawableStart="@drawable/ic_person_black_24dp" android:drawableStart="@drawable/ic_person_black_24dp"
android:hint="@string/msg_name" android:hint="@string/msg_name"
android:imeOptions="actionNext" android:imeOptions="actionNext"
android:inputType="textCapWords" android:inputType="textCapWords" />
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_headline" />
<EditText <EditText
android:id="@+id/text_username" android:id="@+id/text_username"
...@@ -34,10 +40,7 @@ ...@@ -34,10 +40,7 @@
android:drawableStart="@drawable/ic_at_black_24dp" android:drawableStart="@drawable/ic_at_black_24dp"
android:hint="@string/msg_username" android:hint="@string/msg_username"
android:imeOptions="actionNext" android:imeOptions="actionNext"
android:inputType="text" android:inputType="text" />
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_name" />
<EditText <EditText
android:id="@+id/text_password" android:id="@+id/text_password"
...@@ -46,53 +49,51 @@ ...@@ -46,53 +49,51 @@
android:drawableStart="@drawable/ic_lock_black_24dp" android:drawableStart="@drawable/ic_lock_black_24dp"
android:hint="@string/msg_password" android:hint="@string/msg_password"
android:imeOptions="actionNext" android:imeOptions="actionNext"
android:inputType="textPassword" android:inputType="textPassword" />
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_username" />
<EditText <EditText
android:id="@+id/text_email" android:id="@+id/text_email"
style="@style/Authentication.EditText" style="@style/Authentication.EditText"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:drawableStart="@drawable/ic_email_black_24dp" android:drawableStart="@drawable/ic_email_black_24dp"
android:hint="@string/msg_email" android:hint="@string/msg_email"
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:inputType="textEmailAddress" android:inputType="textEmailAddress" />
app:layout_constraintLeft_toLeftOf="parent" </LinearLayout>
app:layout_constraintRight_toRightOf="parent" </ScrollView>
app:layout_constraintTop_toBottomOf="@+id/text_password" />
<com.wang.avi.AVLoadingIndicatorView <com.wang.avi.AVLoadingIndicatorView
android:id="@+id/view_loading" android:id="@+id/view_loading"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_below="@id/scroll_view"
android:layout_centerHorizontal="true"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:visibility="gone" android:visibility="gone"
app:indicatorName="BallPulseIndicator" app:indicatorName="BallPulseIndicator"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_email"
tools:visibility="visible" /> tools:visibility="visible" />
<LinearLayout
android:id="@+id/bottom_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<TextView <TextView
android:id="@+id/text_new_user_agreement" android:id="@+id/text_new_user_agreement"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp" android:layout_gravity="center"
android:layout_marginEnd="@dimen/screen_edge_left_and_right_margins" android:layout_margin="@dimen/screen_edge_left_and_right_margins"
android:layout_marginStart="@dimen/screen_edge_left_and_right_margins"
android:gravity="center" android:gravity="center"
android:textColorLink="@color/colorAccent" android:textColorLink="@color/colorAccent" />
app:layout_constraintBottom_toTopOf="@+id/button_sign_up"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<Button <Button
android:id="@+id/button_sign_up" android:id="@+id/button_sign_up"
style="@style/Authentication.Button" style="@style/Authentication.Button"
android:text="@string/title_sign_up" android:text="@string/title_sign_up" />
app:layout_constraintBottom_toBottomOf="parent" /> </LinearLayout>
</android.support.constraint.ConstraintLayout> </RelativeLayout>
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment