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

Update layout, java classes and string.xml

parent 78db7fe9
...@@ -43,7 +43,7 @@ public class InputHostnameFragment extends AbstractFragment implements InputHost ...@@ -43,7 +43,7 @@ public class InputHostnameFragment extends AbstractFragment implements InputHost
protected void onSetupView() { protected void onSetupView() {
setupVersionInfo(); setupVersionInfo();
container = (ConstraintLayout) rootView.findViewById(R.id.container); container = rootView.findViewById(R.id.container);
waitingView = rootView.findViewById(R.id.waiting); waitingView = rootView.findViewById(R.id.waiting);
rootView.findViewById(R.id.btn_connect).setOnClickListener(view -> handleConnect()); rootView.findViewById(R.id.btn_connect).setOnClickListener(view -> handleConnect());
} }
......
...@@ -6,6 +6,7 @@ import android.support.constraint.ConstraintLayout; ...@@ -6,6 +6,7 @@ import android.support.constraint.ConstraintLayout;
import android.support.design.widget.Snackbar; import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.view.View; import android.view.View;
import android.widget.Button;
import android.widget.TextView; import android.widget.TextView;
import java.util.HashMap; import java.util.HashMap;
...@@ -47,18 +48,19 @@ public class LoginFragment extends AbstractServerConfigFragment implements Login ...@@ -47,18 +48,19 @@ public class LoginFragment extends AbstractServerConfigFragment implements Login
@Override @Override
protected void onSetupView() { 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); Button btnEmail = rootView.findViewById(R.id.btn_login_with_email);
txtUsername = (TextView) rootView.findViewById(R.id.editor_username); Button btnUserRegistration = rootView.findViewById(R.id.btn_user_registration);
txtPasswd = (TextView) rootView.findViewById(R.id.editor_passwd); txtUsername = rootView.findViewById(R.id.editor_username);
txtPasswd = rootView.findViewById(R.id.editor_passwd);
waitingView = rootView.findViewById(R.id.waiting); 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); btnEmail.setOnClickListener(view ->
btnUserRegistration.setOnClickListener(view -> UserRegistrationDialogFragment.create(hostname, presenter.login(txtUsername.getText().toString(), txtPasswd.getText().toString()));
txtUsername.getText().toString(), txtPasswd.getText().toString())
btnUserRegistration.setOnClickListener(view ->
UserRegistrationDialogFragment.create(hostname, txtUsername.getText().toString(), txtPasswd.getText().toString())
.show(getFragmentManager(), "UserRegistrationDialogFragment")); .show(getFragmentManager(), "UserRegistrationDialogFragment"));
} }
......
...@@ -11,9 +11,14 @@ ...@@ -11,9 +11,14 @@
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
android:id="@+id/container" android:id="@+id/container"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:minWidth="288dp" android:minWidth="280dp"
android:layout_height="wrap_content" 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" android:background="@drawable/container_bg"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/version_info" app:layout_constraintBottom_toTopOf="@+id/version_info"
...@@ -36,25 +41,27 @@ ...@@ -36,25 +41,27 @@
android:id="@+id/editor_hostname" android:id="@+id/editor_hostname"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_8"
android:hint="@string/fragment_input_hostname_server_hint" android:hint="@string/fragment_input_hostname_server_hint"
android:imeOptions="actionSend" android:imeOptions="actionSend"
android:inputType="textWebEditText" android:inputType="textWebEditText"
android:maxLines="1" android:maxLines="1"
app:layout_constraintTop_toBottomOf="@+id/hostnameTextView" 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_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:id="@+id/btn_connect"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:elevation="2dp" android:layout_marginTop="@dimen/margin_8"
app:fabSize="mini" android:text="@string/fragment_input_hostname_connect"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp" app:layout_constraintTop_toBottomOf="@+id/editor_hostname"
app:layout_constraintBottom_toBottomOf="@+id/editor_hostname" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintLeft_toRightOf="@+id/editor_hostname" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintRight_toRightOf="parent" /> app:layout_constraintBottom_toBottomOf="parent"
style="@style/Widget.AppCompat.Button.Colored" />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
<chat.rocket.android.widget.WaitingView <chat.rocket.android.widget.WaitingView
...@@ -63,7 +70,7 @@ ...@@ -63,7 +70,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone" android:visibility="gone"
app:layout_constraintTop_toTopOf="parent" 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_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"/> app:layout_constraintRight_toRightOf="parent"/>
......
This diff is collapsed.
...@@ -32,8 +32,11 @@ ...@@ -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_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_hostname">Hostname</string>
<string name="fragment_input_hostname_server_hint">demo.rocket.chat</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_username_or_email">Username or email</string>
<string name="fragment_login_password">Password</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_retry_title">RETRY</string>
<string name="fragment_retry_login_error_title">Connection Error</string> <string name="fragment_retry_login_error_title">Connection Error</string>
<string name="server_config_activity_authenticating">Authenticating…</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