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
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"));
}
......
......@@ -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"/>
......
......@@ -19,58 +19,67 @@
<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_16"
android:paddingStart="@dimen/margin_16"
android:paddingLeft="@dimen/margin_16"
android:paddingEnd="@dimen/margin_16"
android:paddingRight="@dimen/margin_16"
android:paddingTop="@dimen/margin_8"
android:paddingBottom="@dimen/margin_8"
android:background="@drawable/container_bg"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent">
<io.github.yusukeiwaki.android.widget.FontAwesomeButton
<ImageButton
android:id="@+id/btn_login_with_twitter"
android:layout_width="48dp"
android:layout_height="48dp"
android:text="@string/fa_twitter"
android:textSize="16sp"
android:scaleType="fitXY"
app:srcCompat="@drawable/ic_button_twitter_24dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/text_input_username"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/btn_login_with_facebook" />
app:layout_constraintRight_toLeftOf="@+id/btn_login_with_facebook"
android:background="?attr/selectableItemBackgroundBorderless" />
<io.github.yusukeiwaki.android.widget.FontAwesomeButton
<ImageButton
android:id="@+id/btn_login_with_facebook"
android:layout_width="48dp"
android:layout_height="48dp"
android:text="@string/fa_facebook_official"
android:textSize="16sp"
android:scaleType="fitXY"
app:srcCompat="@drawable/ic_button_facebook_24dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/text_input_username"
app:layout_constraintLeft_toRightOf="@+id/btn_login_with_twitter"
app:layout_constraintRight_toLeftOf="@+id/btn_login_with_github" />
app:layout_constraintRight_toLeftOf="@+id/btn_login_with_github"
android:background="?attr/selectableItemBackgroundBorderless" />
<io.github.yusukeiwaki.android.widget.FontAwesomeButton
<ImageButton
android:id="@+id/btn_login_with_github"
android:layout_width="48dp"
android:layout_height="48dp"
android:text="@string/fa_github"
android:textSize="16sp"
android:scaleType="fitXY"
app:srcCompat="@drawable/ic_button_github_24dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/text_input_username"
app:layout_constraintLeft_toRightOf="@+id/btn_login_with_facebook"
app:layout_constraintRight_toLeftOf="@+id/btn_login_with_google" />
app:layout_constraintRight_toLeftOf="@+id/btn_login_with_google"
android:background="?attr/selectableItemBackgroundBorderless" />
<io.github.yusukeiwaki.android.widget.FontAwesomeButton
<ImageButton
android:id="@+id/btn_login_with_google"
android:layout_width="48dp"
android:layout_height="48dp"
android:text="@string/fa_google"
android:textSize="16sp"
android:scaleType="fitXY"
app:srcCompat="@drawable/ic_button_google_24dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/text_input_username"
app:layout_constraintLeft_toRightOf="@+id/btn_login_with_github"
app:layout_constraintRight_toRightOf="parent" />
app:layout_constraintRight_toRightOf="parent"
android:background="?attr/selectableItemBackgroundBorderless" />
<android.support.design.widget.TextInputLayout
android:id="@+id/text_input_username"
......@@ -95,7 +104,6 @@
android:id="@+id/text_input_passwd"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:passwordToggleEnabled="true"
app:layout_constraintTop_toBottomOf="@+id/text_input_username"
app:layout_constraintBottom_toTopOf="@+id/btn_user_registration"
app:layout_constraintLeft_toLeftOf="parent"
......@@ -111,30 +119,29 @@
android:maxLines="1" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.FloatingActionButton
<Button
android:id="@+id/btn_user_registration"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_16"
app:backgroundTint="@color/white"
app:elevation="2dp"
app:fabSize="mini"
app:srcCompat="@drawable/ic_user_registration_blue_24dp"
android:layout_marginTop="@dimen/margin_8"
android:text="@string/fragment_login_sign_up"
app:layout_constraintTop_toBottomOf="@+id/text_input_passwd"
app:layout_constraintRight_toLeftOf="@+id/btn_login_with_email"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
app:layout_constraintBottom_toBottomOf="parent"
style="@style/Widget.AppCompat.Button.Colored" />
<android.support.design.widget.FloatingActionButton
<Button
android:id="@+id/btn_login_with_email"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_16"
app:elevation="2dp"
app:fabSize="normal"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp"
android:layout_marginTop="@dimen/margin_8"
android:text="@string/fragment_login_sign_in"
app:layout_constraintTop_toBottomOf="@+id/text_input_passwd"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
app:layout_constraintLeft_toRightOf="@+id/btn_user_registration"
app:layout_constraintBottom_toBottomOf="parent"
style="@style/Widget.AppCompat.Button.Colored" />
</android.support.constraint.ConstraintLayout>
</ScrollView>
......
......@@ -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