Unverified Commit fbca2b1f authored by Rafael Kellermann Streit's avatar Rafael Kellermann Streit Committed by GitHub

Merge pull request #904 from RocketChat/fix/sign-up-layout

[FIX] Sign up screen
parents f0d47634 d5ffd2a9
...@@ -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">
<TextView <ScrollView
android:id="@+id/text_headline" android:id="@+id/scroll_view"
style="@style/Authentication.Headline.TextView" android:layout_width="match_parent"
android:text="@string/title_sign_up" android:layout_height="wrap_content">
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText <LinearLayout
android:id="@+id/text_name" android:layout_width="match_parent"
style="@style/Authentication.EditText" android:layout_height="wrap_content"
android:layout_marginTop="32dp" android:orientation="vertical">
android:drawableStart="@drawable/ic_person_black_24dp"
android:hint="@string/msg_name"
android:imeOptions="actionNext"
android:inputType="textCapWords"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_headline" />
<EditText <TextView
android:id="@+id/text_username" android:id="@+id/text_headline"
style="@style/Authentication.EditText" style="@style/Authentication.Headline.TextView"
android:layout_marginTop="16dp" android:layout_gravity="center"
android:drawableStart="@drawable/ic_at_black_24dp" android:text="@string/title_sign_up" />
android:hint="@string/msg_username"
android:imeOptions="actionNext"
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_name"
style="@style/Authentication.EditText" style="@style/Authentication.EditText"
android:layout_marginTop="16dp" android:layout_marginTop="32dp"
android:drawableStart="@drawable/ic_lock_black_24dp" android:drawableStart="@drawable/ic_person_black_24dp"
android:hint="@string/msg_password" android:hint="@string/msg_name"
android:imeOptions="actionNext" android:imeOptions="actionNext"
android:inputType="textPassword" android:inputType="textCapWords" />
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_username"
style="@style/Authentication.EditText" style="@style/Authentication.EditText"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:drawableStart="@drawable/ic_email_black_24dp" android:drawableStart="@drawable/ic_at_black_24dp"
android:hint="@string/msg_email" android:hint="@string/msg_username"
android:imeOptions="actionDone" android:imeOptions="actionNext"
android:inputType="textEmailAddress" android:inputType="text" />
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" <EditText
app:layout_constraintTop_toBottomOf="@+id/text_password" /> android:id="@+id/text_password"
style="@style/Authentication.EditText"
android:layout_marginTop="16dp"
android:drawableStart="@drawable/ic_lock_black_24dp"
android:hint="@string/msg_password"
android:imeOptions="actionNext"
android:inputType="textPassword" />
<EditText
android:id="@+id/text_email"
style="@style/Authentication.EditText"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp"
android:drawableStart="@drawable/ic_email_black_24dp"
android:hint="@string/msg_email"
android:imeOptions="actionDone"
android:inputType="textEmailAddress" />
</LinearLayout>
</ScrollView>
<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" />
<TextView <LinearLayout
android:id="@+id/text_new_user_agreement" android:id="@+id/bottom_container"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp" android:layout_alignParentBottom="true"
android:layout_marginEnd="@dimen/screen_edge_left_and_right_margins" android:orientation="vertical">
android:layout_marginStart="@dimen/screen_edge_left_and_right_margins"
android:gravity="center" <TextView
android:textColorLink="@color/colorAccent" android:id="@+id/text_new_user_agreement"
app:layout_constraintBottom_toTopOf="@+id/button_sign_up" android:layout_width="wrap_content"
app:layout_constraintLeft_toLeftOf="parent" android:layout_height="wrap_content"
app:layout_constraintRight_toRightOf="parent" /> android:layout_gravity="center"
android:layout_margin="@dimen/screen_edge_left_and_right_margins"
android:gravity="center"
android:textColorLink="@color/colorAccent" />
<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