Commit 8c74508e authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Updates the sign in to your server view

parent 84523a02
......@@ -48,11 +48,11 @@ class OnBoardingFragment : Fragment(), OnBoardingView {
}
private fun setupOnClickListener() {
container_connect_with_a_server.setOnClickListener { connectWithAServer() }
connect_with_a_server_container.setOnClickListener { connectWithAServer() }
container_join_community.setOnClickListener { joinInTheCommunity() }
join_community_container.setOnClickListener { joinInTheCommunity() }
container_create_server.setOnClickListener { createANewServer() }
create_server_container.setOnClickListener { createANewServer() }
}
override fun showLoading() {
......
......@@ -65,9 +65,9 @@ class ServerFragment : Fragment(), ServerView {
presenter.deepLink(it)
}
text_server_protocol.adapter = ArrayAdapter<String>(activity,
spinner_server_protocol.adapter = ArrayAdapter<String>(activity,
android.R.layout.simple_dropdown_item_1line, arrayOf("https://", "http://"))
text_server_protocol.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
spinner_server_protocol.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
when(position) {
0 -> {
......@@ -85,7 +85,7 @@ class ServerFragment : Fragment(), ServerView {
protocol = "http://"
}
.setNegativeButton(R.string.msg_cancel) { _, _ ->
text_server_protocol.setSelection(0)
spinner_server_protocol.setSelection(0)
}
.setCancelable(false)
.create()
......@@ -197,7 +197,7 @@ class ServerFragment : Fragment(), ServerView {
override fun updateServerUrl(url: HttpUrl) {
if (activity != null && view != null) {
if (url.scheme() == "https") text_server_protocol.setSelection(0) else text_server_protocol.setSelection(1)
if (url.scheme() == "https") spinner_server_protocol.setSelection(0) else spinner_server_protocol.setSelection(1)
protocol = "${url.scheme()}://"
val serverUrl = url.toString().removePrefix("${url.scheme()}://")
......
......@@ -8,7 +8,7 @@
tools:context=".authentication.login.ui.LoginFragment">
<TextView
android:id="@+id/text_headline"
android:id="@+id/text_sign_in_to_your_server"
style="@style/Authentication.Headline.TextView"
android:text="@string/title_log_in"
app:layout_constraintStart_toStartOf="parent"
......@@ -26,7 +26,7 @@
android:inputType="textEmailAddress|text"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_headline" />
app:layout_constraintTop_toBottomOf="@+id/text_sign_in_to_your_server" />
<ImageView
android:id="@+id/image_key"
......
......@@ -36,7 +36,7 @@
app:layout_constraintTop_toBottomOf="@+id/text_on_boarding_title" />
<RelativeLayout
android:id="@+id/container_connect_with_a_server"
android:id="@+id/connect_with_a_server_container"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_marginTop="32dp"
......@@ -58,7 +58,7 @@
tools:ignore="ContentDescription" />
<TextView
style="@style/Authentication.OnBoarding.Button.Title"
style="@style/Authentication.Button.Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
......@@ -79,7 +79,7 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/container_join_community"
android:id="@+id/join_community_container"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_marginTop="10dp"
......@@ -87,7 +87,7 @@
android:foreground="?selectableItemBackground"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/container_connect_with_a_server">
app:layout_constraintTop_toBottomOf="@+id/connect_with_a_server_container">
<ImageView
android:id="@+id/image_join_community"
......@@ -101,7 +101,7 @@
<TextView
android:id="@+id/text_join_community"
style="@style/Authentication.OnBoarding.Button.Title"
style="@style/Authentication.Button.Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
......@@ -110,7 +110,7 @@
android:text="@string/action_join_community" />
<TextView
style="@style/Authentication.OnBoarding.Button.Description"
style="@style/Authentication.Button.Description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/text_join_community"
......@@ -131,7 +131,7 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/container_create_server"
android:id="@+id/create_server_container"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_marginTop="10dp"
......@@ -139,7 +139,7 @@
android:foreground="?selectableItemBackground"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/container_join_community">
app:layout_constraintTop_toBottomOf="@+id/join_community_container">
<ImageView
android:id="@+id/image_add"
......@@ -153,7 +153,7 @@
tools:ignore="ContentDescription" />
<TextView
style="@style/Authentication.OnBoarding.Button.Title.White"
style="@style/Authentication.Button.Title.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
......@@ -168,6 +168,5 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="gone" />
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
......@@ -7,7 +7,7 @@
tools:context=".authentication.registerusername.ui.RegisterUsernameFragment">
<TextView
android:id="@+id/text_headline"
android:id="@+id/text_sign_in_to_your_server"
style="@style/Authentication.Headline.TextView"
android:text="@string/title_register_username"
app:layout_constraintStart_toStartOf="parent"
......@@ -20,7 +20,7 @@
style="@style/Authentication.EditText"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_headline"
app:layout_constraintTop_toBottomOf="@id/text_sign_in_to_your_server"
android:layout_marginTop="16dp"
android:drawableStart="@drawable/ic_at_black_20dp"
android:hint="@string/msg_username"
......
......@@ -7,7 +7,7 @@
tools:context=".authentication.resetpassword.ui.ResetPasswordFragment">
<TextView
android:id="@+id/text_headline"
android:id="@+id/text_sign_in_to_your_server"
style="@style/Authentication.Headline.TextView"
android:text="@string/title_reset_password"
app:layout_constraintTop_toTopOf="parent"
......@@ -20,7 +20,7 @@
style="@style/Authentication.EditText"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_headline"
app:layout_constraintTop_toBottomOf="@id/text_sign_in_to_your_server"
android:layout_marginTop="30dp"
android:drawableStart="@drawable/ic_email_black_20dp"
android:hint="@string/msg_email"
......
......@@ -5,93 +5,84 @@
android:id="@+id/constraint_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusableInTouchMode="true"
android:background="@color/colorWhite"
android:focusableInTouchMode="true"
android:padding="@dimen/screen_edge_left_and_right_margins"
tools:context=".authentication.server.ui.ServerFragment">
<ImageView
android:id="@+id/image_server"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:src="@drawable/ic_server"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="40dp" />
tools:ignore="ContentDescription" />
<TextView
android:id="@+id/text_headline"
android:id="@+id/text_sign_in_to_your_server"
style="@style/Authentication.Headline.TextView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/image_server"
android:layout_marginTop="8dp"
android:text="@string/title_sign_in_your_server" />
android:text="@string/title_sign_in_your_server"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/image_server" />
<RelativeLayout
android:id="@+id/view_server"
android:id="@+id/server_url_container"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_marginTop="24dp"
android:background="@drawable/rounded_border"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_headline"
android:layout_marginTop="24dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_sign_in_to_your_server">
<FrameLayout
android:id="@+id/protocol_container"
android:layout_width="wrap_content"
android:layout_height="match_parent"
>
android:layout_height="match_parent">
<Spinner
android:id="@+id/text_server_protocol"
android:spinnerMode="dropdown"
android:layout_width="120dp"
android:id="@+id/spinner_server_protocol"
android:layout_width="100dp"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:backgroundTint="@color/actionMenuColor" />
android:popupBackground="@color/colorWhite" />
</FrameLayout>
<EditText
android:id="@+id/text_server_url"
style="@style/Authentication.Text.Hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="6dp"
android:layout_marginEnd="16dp"
android:layout_toEndOf="@+id/protocol_container"
android:background="@color/colorWhite"
android:cursorVisible="false"
android:hint="@string/default_server"
android:hint="@string/server_hint_url"
android:imeOptions="actionDone"
android:inputType="text|textUri"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_centerVertical="true"
android:textSize="17sp"
android:textColorHint="#9ea2a8"
android:textColor="#9ea2a8"
android:layout_toEndOf="@id/protocol_container"
android:background="@color/colorWhite" />
android:inputType="text|textUri" />
</RelativeLayout>
<Button
android:id="@+id/button_connect"
style="@style/Authentication.Button"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/view_server"
android:text="@string/action_connect"
android:layout_marginTop="20dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp" />
android:text="@string/action_connect"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/server_url_container" />
<com.wang.avi.AVLoadingIndicatorView
android:id="@+id/view_loading"
style="@style/Authentication.AVLoadingIndicatorView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:visibility="gone"
tools:visibility="visible" />
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
......@@ -9,7 +9,7 @@
tools:context=".authentication.signup.ui.SignupFragment">
<TextView
android:id="@+id/text_headline"
android:id="@+id/text_sign_in_to_your_server"
style="@style/Authentication.Headline.TextView"
android:text="@string/title_sign_up"
app:layout_constraintTop_toTopOf="parent"
......@@ -22,7 +22,7 @@
style="@style/Authentication.EditText"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_headline"
app:layout_constraintTop_toBottomOf="@id/text_sign_in_to_your_server"
android:layout_marginTop="16dp"
android:drawableStart="@drawable/ic_person_black_20dp"
android:hint="@string/msg_name"
......
......@@ -7,7 +7,7 @@
tools:context=".authentication.twofactor.ui.TwoFAFragment">
<TextView
android:id="@+id/text_headline"
android:id="@+id/text_sign_in_to_your_server"
style="@style/Authentication.Headline.TextView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
......@@ -19,14 +19,14 @@
android:id="@+id/text_description"
style="@style/Authentication.Description.TextView"
android:text="What’s your 2FA code?"
app:layout_constraintTop_toBottomOf="@id/text_headline"
app:layout_constraintStart_toStartOf="@id/text_headline"
app:layout_constraintTop_toBottomOf="@id/text_sign_in_to_your_server"
app:layout_constraintStart_toStartOf="@id/text_sign_in_to_your_server"
android:layout_marginTop="4dp" />
<EditText
android:id="@+id/text_two_factor_auth"
style="@style/Authentication.EditText"
android:layout_below="@id/text_headline"
android:layout_below="@id/text_sign_in_to_your_server"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_description"
......
......@@ -25,7 +25,7 @@
<!-- Authentication colors -->
<color name="colorAuthenticationOnBoardingButtonBorder">#FFE1E5E8</color>
<color name="colorAuthenticationOnBoardingChevron">#FFCBCED1</color>
<color name="colorAuthenticationOnBoardingTextDescription">#FF9EA2A8</color>
<color name="colorAuthenticationOnBoardingSecondaryText">#FF9EA2A8</color>
<color name="darkGray">#FFa0a0a0</color>
<color name="actionMenuColor">#FF727272</color>
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="default_protocol" translatable="false">https://</string>
<string name="default_server" translatable="false">open.rocket.chat</string>
<string name="server_hint_url" translatable="false">your-company.rocket.chat</string>
<string name="community_server_url" translatable="false">open.rocket.chat</string>
<string name="create_server_url" translatable="false">cloud.rocket.chat/trial</string>
</resources>
\ No newline at end of file
......@@ -42,8 +42,8 @@
<item name="android:textStyle">normal</item>
</style>
<!-- OnBoarding -->
<style name="Authentication.OnBoarding.Button.Title" parent="TextAppearance.AppCompat">
<!-- Authentication -->
<style name="Authentication.Button.Title" parent="TextAppearance.AppCompat">
<item name="android:textSize">17sp</item>
<item name="android:fontFamily">sans-serif</item>
<item name="android:textStyle">bold</item>
......@@ -51,18 +51,26 @@
<item name="android:letterSpacing">0.04</item>
</style>
<style name="Authentication.OnBoarding.Button.Title.White" parent="Authentication.OnBoarding.Button.Title">
<style name="Authentication.Button.Title.White" parent="Authentication.Button.Title">
<item name="android:textColor">@color/colorWhite</item>
</style>
<style name="Authentication.OnBoarding.Button.Description" parent="TextAppearance.AppCompat">
<style name="Authentication.Button.Description" parent="TextAppearance.AppCompat">
<item name="android:textSize">15sp</item>
<item name="android:fontFamily">sans-serif</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">@color/colorAuthenticationOnBoardingTextDescription</item>
<item name="android:textColor">@color/colorAuthenticationOnBoardingSecondaryText</item>
<item name="android:letterSpacing">0.04</item>
</style>
<style name="Authentication.Text.Hint" parent="TextAppearance.AppCompat">
<item name="android:textSize">17sp</item>
<item name="android:fontFamily">sans-serif</item>
<item name="android:textStyle">normal</item>
<item name="android:textColorHint">@color/colorAuthenticationOnBoardingSecondaryText</item>
<item name="android:lineSpacingExtra">3sp</item>
</style>
<style name="Authentication.EditText" parent="Widget.AppCompat.EditText">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">48dp</item>
......@@ -78,13 +86,16 @@
<item name="android:background">@drawable/rounded_border</item>
</style>
<style name="Authentication.Button" parent="Widget.AppCompat.Button">
<style name="Authentication.Button" parent="Widget.AppCompat.Button.Borderless">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">48dp</item>
<item name="android:layout_marginStart">16dp</item>
<item name="android:layout_marginEnd">16dp</item>
<item name="android:textColor">@color/colorWhite</item>
<item name="android:foreground">?selectableItemBackground</item>
<item name="android:radius">60dp</item>
<item name="android:textSize">18sp</item>
<item name="android:fontFamily">sans-serif-medium</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">@color/colorWhite</item>
<item name="android:lineSpacingExtra">2sp</item>
<item name="android:textAllCaps">false</item>
<item name="android:background">@drawable/rounded_color_accent</item>
</style>
......
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