Unverified Commit dbfcde7e authored by Filipe de Lima Brito's avatar Filipe de Lima Brito Committed by GitHub

Merge pull request #1771 from RocketChat/fix/onboarding

[FIX] Fixes for Onboarding/Authentication
parents c9471b6a 71328567
......@@ -72,6 +72,7 @@ class LoginOptionsPresenter @Inject constructor(
credentialToken = oauthToken
credentialSecret = oauthSecret
loginMethod = AuthenticationEvent.AuthenticationWithOauth
setupConnectionInfo(currentServer)
doAuthentication(TYPE_LOGIN_OAUTH)
}
......@@ -79,6 +80,7 @@ class LoginOptionsPresenter @Inject constructor(
setupConnectionInfo(currentServer)
credentialToken = casToken
loginMethod = AuthenticationEvent.AuthenticationWithCas
setupConnectionInfo(currentServer)
doAuthentication(TYPE_LOGIN_CAS)
}
......@@ -86,6 +88,7 @@ class LoginOptionsPresenter @Inject constructor(
setupConnectionInfo(currentServer)
credentialToken = samlToken
loginMethod = AuthenticationEvent.AuthenticationWithSaml
setupConnectionInfo(currentServer)
doAuthentication(TYPE_LOGIN_SAML)
}
......
......@@ -9,6 +9,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.LinearLayout
import androidx.appcompat.view.ContextThemeWrapper
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import chat.rocket.android.R
......@@ -18,11 +19,7 @@ import chat.rocket.android.authentication.domain.model.LoginDeepLinkInfo
import chat.rocket.android.authentication.loginoptions.presentation.LoginOptionsPresenter
import chat.rocket.android.authentication.loginoptions.presentation.LoginOptionsView
import chat.rocket.android.authentication.ui.AuthenticationActivity
import chat.rocket.android.util.extensions.clearLightStatusBar
import chat.rocket.android.util.extensions.inflate
import chat.rocket.android.util.extensions.rotateBy
import chat.rocket.android.util.extensions.showToast
import chat.rocket.android.util.extensions.ui
import chat.rocket.android.util.extensions.*
import chat.rocket.android.webview.oauth.ui.INTENT_OAUTH_CREDENTIAL_SECRET
import chat.rocket.android.webview.oauth.ui.INTENT_OAUTH_CREDENTIAL_TOKEN
import chat.rocket.android.webview.oauth.ui.oauthWebViewIntent
......@@ -290,7 +287,6 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView {
}
}
// OAuth Accounts.
override fun enableLoginByFacebook() = enableAccountButton(button_facebook)
......@@ -337,8 +333,8 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView {
buttonColor: Int
) {
val button = getCustomServiceButton(serviceName, serviceNameColor, buttonColor)
accounts_container.addView(button)
setupButtonListener(button, customOauthUrl, state, REQUEST_CODE_FOR_OAUTH)
accounts_container.addView(button)
}
// SAML account.
......@@ -350,8 +346,8 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView {
buttonColor: Int
) {
val button = getCustomServiceButton(serviceName, serviceNameColor, buttonColor)
accounts_container.addView(button)
setupButtonListener(button, samlUrl, samlToken, REQUEST_CODE_FOR_SAML)
accounts_container.addView(button)
}
override fun showAccountsView() {
......@@ -487,7 +483,11 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView {
val marginTop = resources.getDimensionPixelSize(R.dimen.button_account_margin_top)
params.setMargins(0, marginTop, 0, 0)
val button = Button(context)
val button = Button(
ContextThemeWrapper(context, R.style.Authentication_Button),
null,
R.style.Authentication_Button
)
button.layoutParams = params
button.text = buttonText
button.setTextColor(buttonTextColor)
......
......@@ -12,18 +12,19 @@
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
<LinearLayout
android:id="@+id/accounts_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
android:orientation="vertical"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible">
<Button
android:id="@+id/button_facebook"
style="?borderlessButtonStyle"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/rounded_border"
android:clickable="false"
......@@ -36,15 +37,12 @@
android:textColor="@color/colorPrimary"
android:textSize="16sp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />
<Button
android:id="@+id/button_github"
style="?borderlessButtonStyle"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="10dp"
android:background="@drawable/rounded_border"
......@@ -58,15 +56,12 @@
android:textColor="@color/colorPrimary"
android:textSize="16sp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button_facebook"
tools:visibility="visible" />
<Button
android:id="@+id/button_google"
style="?borderlessButtonStyle"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="10dp"
android:background="@drawable/rounded_border"
......@@ -80,15 +75,12 @@
android:textColor="@color/colorPrimary"
android:textSize="16sp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button_github"
tools:visibility="visible" />
<Button
android:id="@+id/button_linkedin"
style="?borderlessButtonStyle"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="10dp"
android:background="@drawable/rounded_border"
......@@ -102,15 +94,12 @@
android:textColor="@color/colorPrimary"
android:textSize="16sp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button_google"
tools:visibility="visible" />
<Button
android:id="@+id/button_gitlab"
style="?borderlessButtonStyle"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="10dp"
android:background="@drawable/rounded_border"
......@@ -124,15 +113,12 @@
android:textColor="@color/colorPrimary"
android:textSize="16sp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button_linkedin"
tools:visibility="visible" />
<Button
android:id="@+id/button_wordpress"
style="?borderlessButtonStyle"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="10dp"
android:background="@drawable/rounded_border"
......@@ -146,9 +132,6 @@
android:textColor="@color/colorPrimary"
android:textSize="16sp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button_gitlab"
tools:visibility="visible" />
<Button
......@@ -158,11 +141,8 @@
android:clickable="false"
android:text="@string/action_login_or_sign_up"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button_wordpress"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/expand_more_accounts_container"
......
......@@ -80,7 +80,7 @@
</style>
<style name="Authentication.Button" parent="Widget.AppCompat.Button.Borderless">
<item name="android:layout_width">0dp</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">48dp</item>
<item name="android:foreground">?selectableItemBackground</item>
<item name="android:textSize">18sp</item>
......
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