Commit 91ca4280 authored by Rafael Kellermann Streit's avatar Rafael Kellermann Streit Committed by GitHub

Merge pull request #352 from filipedelimabrito/ux

Ux
parents 3fa0cd78 aca857cf
......@@ -43,7 +43,7 @@ public class InputHostnameFragment extends AbstractFragment implements InputHost
protected void onSetupView() {
setupVersionInfo();
container = (ConstraintLayout) rootView.findViewById(R.id.container);
container = rootView.findViewById(R.id.container);
waitingView = rootView.findViewById(R.id.waiting);
rootView.findViewById(R.id.btn_connect).setOnClickListener(view -> handleConnect());
}
......
......@@ -6,6 +6,7 @@ import android.support.constraint.ConstraintLayout;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import java.util.HashMap;
......@@ -47,18 +48,19 @@ public class LoginFragment extends AbstractServerConfigFragment implements Login
@Override
protected void onSetupView() {
container = (ConstraintLayout) rootView.findViewById(R.id.container);
container = rootView.findViewById(R.id.container);
View btnEmail = rootView.findViewById(R.id.btn_login_with_email);
txtUsername = (TextView) rootView.findViewById(R.id.editor_username);
txtPasswd = (TextView) rootView.findViewById(R.id.editor_passwd);
Button btnEmail = rootView.findViewById(R.id.btn_login_with_email);
Button btnUserRegistration = rootView.findViewById(R.id.btn_user_registration);
txtUsername = rootView.findViewById(R.id.editor_username);
txtPasswd = rootView.findViewById(R.id.editor_passwd);
waitingView = rootView.findViewById(R.id.waiting);
btnEmail.setOnClickListener(
view -> presenter.login(txtUsername.getText().toString(), txtPasswd.getText().toString()));
final View btnUserRegistration = rootView.findViewById(R.id.btn_user_registration);
btnUserRegistration.setOnClickListener(view -> UserRegistrationDialogFragment.create(hostname,
txtUsername.getText().toString(), txtPasswd.getText().toString())
btnEmail.setOnClickListener(view ->
presenter.login(txtUsername.getText().toString(), txtPasswd.getText().toString()));
btnUserRegistration.setOnClickListener(view ->
UserRegistrationDialogFragment.create(hostname, txtUsername.getText().toString(), txtPasswd.getText().toString())
.show(getFragmentManager(), "UserRegistrationDialogFragment"));
}
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M12,12m-12,0a12,12 0,1 1,24 0a12,12 0,1 1,-24 0"
android:fillColor="#2C5C9B"/>
<path
android:pathData="M10.937,8.798C10.937,9.032 10.937,10.077 10.937,10.077L10,10.077L10,11.64L10.937,11.64L10.937,16.286L12.862,16.286L12.862,11.64L14.154,11.64C14.154,11.64 14.275,10.891 14.334,10.071C14.166,10.071 12.87,10.071 12.87,10.071C12.87,10.071 12.87,9.162 12.87,9.002C12.87,8.842 13.079,8.628 13.287,8.628C13.494,8.628 13.931,8.628 14.336,8.628C14.336,8.415 14.336,7.679 14.336,7C13.795,7 13.181,7 12.91,7C10.89,7 10.937,8.565 10.937,8.798Z"
android:fillColor="#FFFFFF"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M12,12m-12,0a12,12 0,1 1,24 0a12,12 0,1 1,-24 0"
android:fillColor="#4C4C4C"/>
<path
android:pathData="M16.972,8.938C16.446,8.037 15.733,7.324 14.832,6.798C13.931,6.273 12.947,6.01 11.88,6.01C10.813,6.01 9.829,6.273 8.929,6.798C8.028,7.324 7.314,8.037 6.789,8.938C6.263,9.839 6,10.823 6,11.89C6,13.171 6.374,14.323 7.122,15.347C7.869,16.37 8.835,17.078 10.02,17.471C10.157,17.497 10.259,17.479 10.326,17.418C10.392,17.357 10.425,17.28 10.425,17.188C10.425,17.173 10.424,17.035 10.421,16.775C10.419,16.514 10.418,16.287 10.418,16.093L10.242,16.124C10.129,16.144 9.988,16.153 9.817,16.151C9.646,16.148 9.468,16.13 9.284,16.097C9.101,16.064 8.93,15.988 8.771,15.868C8.613,15.748 8.501,15.591 8.435,15.397L8.358,15.221C8.307,15.103 8.227,14.973 8.117,14.83C8.007,14.687 7.896,14.59 7.784,14.539L7.73,14.501C7.695,14.475 7.661,14.445 7.631,14.409C7.6,14.373 7.577,14.337 7.562,14.302C7.547,14.266 7.559,14.237 7.6,14.214C7.641,14.19 7.715,14.179 7.822,14.179L7.975,14.202C8.077,14.223 8.204,14.284 8.354,14.386C8.505,14.488 8.629,14.621 8.726,14.784C8.843,14.993 8.985,15.153 9.151,15.263C9.316,15.372 9.484,15.427 9.652,15.427C9.82,15.427 9.966,15.414 10.088,15.389C10.211,15.363 10.326,15.325 10.433,15.274C10.479,14.932 10.604,14.669 10.808,14.485C10.517,14.455 10.256,14.409 10.023,14.347C9.791,14.286 9.551,14.187 9.304,14.049C9.056,13.911 8.851,13.74 8.687,13.536C8.524,13.332 8.39,13.064 8.285,12.732C8.181,12.4 8.128,12.017 8.128,11.583C8.128,10.966 8.33,10.44 8.733,10.006C8.544,9.542 8.562,9.021 8.787,8.444C8.935,8.398 9.154,8.433 9.445,8.548C9.736,8.662 9.949,8.761 10.085,8.842C10.22,8.924 10.328,8.993 10.41,9.049C10.885,8.917 11.375,8.85 11.88,8.85C12.385,8.85 12.875,8.917 13.35,9.049L13.641,8.865C13.84,8.743 14.075,8.631 14.346,8.529C14.616,8.427 14.823,8.398 14.966,8.444C15.195,9.021 15.216,9.542 15.027,10.006C15.43,10.44 15.632,10.966 15.632,11.583C15.632,12.017 15.579,12.401 15.475,12.736C15.37,13.07 15.235,13.338 15.069,13.54C14.903,13.741 14.697,13.911 14.449,14.049C14.202,14.187 13.962,14.286 13.729,14.347C13.497,14.409 13.236,14.455 12.945,14.485C13.21,14.715 13.343,15.077 13.343,15.573L13.343,17.188C13.343,17.28 13.375,17.356 13.438,17.418C13.502,17.479 13.603,17.497 13.741,17.471C14.925,17.078 15.891,16.37 16.639,15.346C17.386,14.323 17.76,13.171 17.76,11.89C17.76,10.823 17.497,9.839 16.972,8.938Z"
android:fillColor="#FFFFFF"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M12,12m-12,0a12,12 0,1 1,24 0a12,12 0,1 1,-24 0"
android:fillColor="#DF4F38"/>
<path
android:pathData="M9.214,13.036L8.866,14.334L7.595,14.361C7.215,13.657 7,12.851 7,11.994C7,11.166 7.201,10.385 7.558,9.698L7.559,9.698L8.69,9.905L9.186,11.03C9.082,11.332 9.025,11.657 9.025,11.994C9.026,12.361 9.092,12.712 9.214,13.036Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M16.902,11.061C16.959,11.364 16.989,11.676 16.989,11.994C16.989,12.352 16.951,12.701 16.88,13.037C16.637,14.182 16.001,15.182 15.121,15.889L15.121,15.889L13.696,15.816L13.494,14.557C14.078,14.215 14.535,13.679 14.775,13.037L12.104,13.037L12.104,11.061L14.814,11.061L16.902,11.061L16.902,11.061Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M15.121,15.889L15.121,15.889C14.265,16.577 13.178,16.989 11.994,16.989C10.092,16.989 8.439,15.926 7.595,14.361L9.214,13.036C9.636,14.162 10.721,14.963 11.994,14.963C12.542,14.963 13.054,14.816 13.494,14.557L15.121,15.889Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M15.182,8.15L13.564,9.474C13.109,9.19 12.571,9.025 11.994,9.025C10.693,9.025 9.586,9.864 9.186,11.03L7.559,9.698L7.558,9.698C8.39,8.095 10.064,7 11.994,7C13.206,7 14.317,7.432 15.182,8.15Z"
android:fillColor="#FFFFFF"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M12,12m-12,0a12,12 0,1 1,24 0a12,12 0,1 1,-24 0"
android:fillColor="#00ACEE"/>
<path
android:pathData="M17.478,9.015C17.092,9.185 16.678,9.301 16.244,9.353C16.688,9.087 17.027,8.666 17.188,8.165C16.772,8.411 16.312,8.59 15.823,8.687C15.43,8.268 14.873,8.008 14.254,8.008C13.067,8.008 12.104,8.97 12.104,10.156C12.104,10.325 12.123,10.489 12.16,10.646C10.374,10.556 8.79,9.701 7.73,8.4C7.545,8.717 7.439,9.087 7.439,9.481C7.439,10.226 7.819,10.885 8.395,11.269C8.043,11.258 7.712,11.161 7.422,11L7.422,11.027C7.422,12.068 8.163,12.936 9.146,13.134C8.966,13.183 8.776,13.21 8.579,13.21C8.44,13.21 8.306,13.196 8.175,13.17C8.448,14.024 9.242,14.645 10.182,14.662C9.447,15.239 8.52,15.581 7.513,15.581C7.339,15.581 7.168,15.571 7,15.552C7.951,16.162 9.081,16.519 10.295,16.519C14.249,16.519 16.41,13.244 16.41,10.403L16.403,10.125C16.825,9.824 17.19,9.445 17.478,9.015Z"
android:fillColor="#FFFFFF"/>
</vector>
......@@ -11,9 +11,14 @@
<android.support.constraint.ConstraintLayout
android:id="@+id/container"
android:layout_width="wrap_content"
android:minWidth="288dp"
android:minWidth="280dp"
android:layout_height="wrap_content"
android:padding="@dimen/margin_24"
android:paddingStart="@dimen/margin_16"
android:paddingLeft="@dimen/margin_16"
android:paddingEnd="@dimen/margin_16"
android:paddingRight="@dimen/margin_16"
android:paddingTop="@dimen/margin_16"
android:paddingBottom="@dimen/margin_8"
android:background="@drawable/container_bg"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/version_info"
......@@ -36,25 +41,27 @@
android:id="@+id/editor_hostname"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_8"
android:hint="@string/fragment_input_hostname_server_hint"
android:imeOptions="actionSend"
android:inputType="textWebEditText"
android:maxLines="1"
app:layout_constraintTop_toBottomOf="@+id/hostnameTextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@+id/btn_connect"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/btn_connect" />
app:layout_constraintRight_toRightOf="parent" />
<android.support.design.widget.FloatingActionButton
<Button
android:id="@+id/btn_connect"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:elevation="2dp"
app:fabSize="mini"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp"
app:layout_constraintBottom_toBottomOf="@+id/editor_hostname"
app:layout_constraintLeft_toRightOf="@+id/editor_hostname"
app:layout_constraintRight_toRightOf="parent" />
android:layout_marginTop="@dimen/margin_8"
android:text="@string/fragment_input_hostname_connect"
app:layout_constraintTop_toBottomOf="@+id/editor_hostname"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
style="@style/Widget.AppCompat.Button.Colored" />
</android.support.constraint.ConstraintLayout>
<chat.rocket.android.widget.WaitingView
......@@ -63,7 +70,7 @@
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/version_info"
app:layout_constraintBottom_toTopOf="@+id/version_info"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"/>
......
This diff is collapsed.
......@@ -32,8 +32,11 @@
<string name="fragment_home_welcome_message">Welcome to Rocket.Chat.Android\nSelect a channel from the drawer.</string>
<string name="fragment_input_hostname_hostname">Hostname</string>
<string name="fragment_input_hostname_server_hint">demo.rocket.chat</string>
<string name="fragment_input_hostname_connect">CONNECT</string>
<string name="fragment_login_username_or_email">Username or email</string>
<string name="fragment_login_password">Password</string>
<string name="fragment_login_sign_up">SIGN UP</string>
<string name="fragment_login_sign_in">SIGN IN</string>
<string name="fragment_retry_login_retry_title">RETRY</string>
<string name="fragment_retry_login_error_title">Connection Error</string>
<string name="server_config_activity_authenticating">Authenticating…</string>
......
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