Commit 84523a02 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Refactor on the OnBoardingFragment

Fix the rocket.chat icon being draw incorrect on on boarding screen.
Adds proper widget themes.
Correct status bar color is now displayed accordingly the fragment (as per our desing).
Removes unneeded code.
parent 5c4bb503
...@@ -9,14 +9,14 @@ ...@@ -9,14 +9,14 @@
<application <application
android:name=".app.RocketChatApplication" android:name=".app.RocketChatApplication"
tools:replace="android:name"
android:allowBackup="true" android:allowBackup="true"
android:fullBackupContent="@xml/backup_config" android:fullBackupContent="@xml/backup_config"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config" android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"> android:supportsRtl="true"
tools:replace="android:name">
<activity <activity
android:name=".authentication.ui.AuthenticationActivity" android:name=".authentication.ui.AuthenticationActivity"
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
...@@ -40,6 +41,7 @@ ...@@ -40,6 +41,7 @@
<data <data
android:host="auth" android:host="auth"
android:scheme="rocketchat" /> android:scheme="rocketchat" />
<data <data
android:host="go.rocket.chat" android:host="go.rocket.chat"
android:path="/auth" android:path="/auth"
......
...@@ -2,16 +2,18 @@ package chat.rocket.android.authentication.loginoptions.ui ...@@ -2,16 +2,18 @@ package chat.rocket.android.authentication.loginoptions.ui
import android.app.Activity import android.app.Activity
import android.content.Intent import android.content.Intent
import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.view.* import android.view.LayoutInflater
import androidx.fragment.app.Fragment import android.view.View
import android.view.ViewGroup
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import chat.rocket.android.R import chat.rocket.android.R
import chat.rocket.android.authentication.login.ui.REQUEST_CODE_FOR_OAUTH import chat.rocket.android.authentication.login.ui.REQUEST_CODE_FOR_OAUTH
import chat.rocket.android.authentication.loginoptions.presentation.LoginOptionsPresenter import chat.rocket.android.authentication.loginoptions.presentation.LoginOptionsPresenter
import chat.rocket.android.authentication.loginoptions.presentation.LoginOptionsView import chat.rocket.android.authentication.loginoptions.presentation.LoginOptionsView
import chat.rocket.android.authentication.ui.AuthenticationActivity import chat.rocket.android.authentication.ui.AuthenticationActivity
import chat.rocket.android.util.extensions.clearLightStatusBar
import chat.rocket.android.util.extensions.rotateBy import chat.rocket.android.util.extensions.rotateBy
import chat.rocket.android.util.extensions.showToast import chat.rocket.android.util.extensions.showToast
import chat.rocket.android.util.extensions.ui import chat.rocket.android.util.extensions.ui
...@@ -23,7 +25,7 @@ import kotlinx.android.synthetic.main.app_bar_chat_room.* ...@@ -23,7 +25,7 @@ import kotlinx.android.synthetic.main.app_bar_chat_room.*
import kotlinx.android.synthetic.main.fragment_authentication_login_options.* import kotlinx.android.synthetic.main.fragment_authentication_login_options.*
import javax.inject.Inject import javax.inject.Inject
internal const val TAG_LOGIN_OPTIONS = "LoginOptionsFragment"
private const val BUNDLE_SERVER_NAME = "BUNDLE_SERVER_NAME" private const val BUNDLE_SERVER_NAME = "BUNDLE_SERVER_NAME"
class LoginOptionsFragment : Fragment(), LoginOptionsView { class LoginOptionsFragment : Fragment(), LoginOptionsView {
...@@ -33,7 +35,7 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView { ...@@ -33,7 +35,7 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView {
private var server: String? = null private var server: String? = null
companion object { companion object {
fun newInstance(server: String) : LoginOptionsFragment { fun newInstance(server: String): LoginOptionsFragment {
return LoginOptionsFragment().apply { return LoginOptionsFragment().apply {
arguments = Bundle(1).apply { arguments = Bundle(1).apply {
putString(BUNDLE_SERVER_NAME, server) putString(BUNDLE_SERVER_NAME, server)
...@@ -52,7 +54,8 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView { ...@@ -52,7 +54,8 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView {
} }
} }
override fun onCreateView(inflater: LayoutInflater, override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?, container: ViewGroup?,
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View? = inflater.inflate(R.layout.fragment_authentication_login_options, container, false) ): View? = inflater.inflate(R.layout.fragment_authentication_login_options, container, false)
...@@ -71,12 +74,12 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView { ...@@ -71,12 +74,12 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView {
button_login.setOnClickListener { button_login.setOnClickListener {
presenter.toLogin() presenter.toLogin()
} }
image_more_login_option.setOnClickListener{ image_more_login_option.setOnClickListener {
if (it.rotation == 0f){ if (it.rotation == 0f) {
image_more_login_option.rotateBy(180f) image_more_login_option.rotateBy(180f)
button_linkedin.isVisible = true button_linkedin.isVisible = true
button_gitlab.isVisible = true button_gitlab.isVisible = true
}else { } else {
image_more_login_option.rotateBy(-180f) image_more_login_option.rotateBy(-180f)
button_linkedin.isVisible = false button_linkedin.isVisible = false
button_gitlab.isVisible = false button_gitlab.isVisible = false
...@@ -85,14 +88,15 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView { ...@@ -85,14 +88,15 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView {
} }
private fun setupToolbar() { private fun setupToolbar() {
val toolbar = (activity as AuthenticationActivity).toolbar with((activity as AuthenticationActivity)) {
view?.let { clearLightStatusBar(it) }
toolbar.isVisible = true toolbar.isVisible = true
val textServerName = (activity as AuthenticationActivity).text_room_name text_room_name.text = server?.replace(getString(R.string.default_protocol), "")
textServerName.text = server?.replace("https://","") }
} }
override fun enableLoginByFacebook() { override fun enableLoginByFacebook() {
ui{ ui {
button_facebook.isClickable = true button_facebook.isClickable = true
} }
} }
...@@ -182,8 +186,8 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView { ...@@ -182,8 +186,8 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView {
} }
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (resultCode == Activity.RESULT_OK && data != null){ if (resultCode == Activity.RESULT_OK && data != null) {
when(requestCode){ when (requestCode) {
REQUEST_CODE_FOR_OAUTH -> { REQUEST_CODE_FOR_OAUTH -> {
presenter.authenticateWithOauth( presenter.authenticateWithOauth(
data.getStringExtra(INTENT_OAUTH_CREDENTIAL_TOKEN), data.getStringExtra(INTENT_OAUTH_CREDENTIAL_TOKEN),
......
...@@ -18,19 +18,14 @@ class OnBoardingFragmentModule { ...@@ -18,19 +18,14 @@ class OnBoardingFragmentModule {
@Provides @Provides
@PerFragment @PerFragment
fun onBoardingView(frag: OnBoardingFragment): OnBoardingView{ fun onBoardingView(frag: OnBoardingFragment): OnBoardingView = frag
return frag
}
@Provides @Provides
@PerFragment @PerFragment
fun provideLifecycleOwner(frag: OnBoardingFragment): LifecycleOwner { fun provideLifecycleOwner(frag: OnBoardingFragment): LifecycleOwner = frag
return frag
}
@Provides @Provides
@PerFragment @PerFragment
fun provideCancelStrategy(owner: LifecycleOwner, jobs: Job): CancelStrategy { fun provideCancelStrategy(owner: LifecycleOwner, jobs: Job): CancelStrategy =
return CancelStrategy(owner, jobs) CancelStrategy(owner, jobs)
}
} }
\ No newline at end of file
...@@ -5,7 +5,8 @@ import chat.rocket.android.dagger.scope.PerFragment ...@@ -5,7 +5,8 @@ import chat.rocket.android.dagger.scope.PerFragment
import dagger.Module import dagger.Module
import dagger.android.ContributesAndroidInjector import dagger.android.ContributesAndroidInjector
@Module abstract class OnBoardingFragmentProvider { @Module
abstract class OnBoardingFragmentProvider {
@ContributesAndroidInjector(modules = [OnBoardingFragmentModule::class]) @ContributesAndroidInjector(modules = [OnBoardingFragmentModule::class])
@PerFragment @PerFragment
......
package chat.rocket.android.authentication.onboarding.presentation package chat.rocket.android.authentication.onboarding.presentation
import chat.rocket.android.authentication.domain.model.LoginDeepLinkInfo
import chat.rocket.android.authentication.presentation.AuthenticationNavigator import chat.rocket.android.authentication.presentation.AuthenticationNavigator
import chat.rocket.android.core.behaviours.showMessage import chat.rocket.android.core.behaviours.showMessage
import chat.rocket.android.core.lifecycle.CancelStrategy import chat.rocket.android.core.lifecycle.CancelStrategy
...@@ -7,7 +8,6 @@ import chat.rocket.android.server.domain.GetAccountsInteractor ...@@ -7,7 +8,6 @@ import chat.rocket.android.server.domain.GetAccountsInteractor
import chat.rocket.android.server.domain.RefreshSettingsInteractor import chat.rocket.android.server.domain.RefreshSettingsInteractor
import chat.rocket.android.server.domain.SaveConnectingServerInteractor import chat.rocket.android.server.domain.SaveConnectingServerInteractor
import chat.rocket.android.util.extension.launchUI import chat.rocket.android.util.extension.launchUI
import chat.rocket.android.util.extensions.isValidUrl
import javax.inject.Inject import javax.inject.Inject
class OnBoardingPresenter @Inject constructor( class OnBoardingPresenter @Inject constructor(
...@@ -18,21 +18,16 @@ class OnBoardingPresenter @Inject constructor( ...@@ -18,21 +18,16 @@ class OnBoardingPresenter @Inject constructor(
private val refreshSettingsInteractor: RefreshSettingsInteractor, private val refreshSettingsInteractor: RefreshSettingsInteractor,
private val getAccountsInteractor: GetAccountsInteractor private val getAccountsInteractor: GetAccountsInteractor
) { ) {
fun createServer(){
navigator.toWebPage("https://cloud.rocket.chat/trial")
}
fun connect(server: String) { fun toConnectWithAServer(deepLinkInfo: LoginDeepLinkInfo?) =
//code that leads to login screen (smart lock will be implemented after this) navigator.toConnectWithAServer(deepLinkInfo)
connectToServer(server) {
navigator.toLoginOptions(server) fun connectToCommunityServer(communityServer: String) =
} connectToServer(communityServer) { navigator.toLoginOptions(communityServer) }
}
fun toCreateANewServer(createServerUrl: String) = navigator.toWebPage(createServerUrl)
private fun connectToServer(server: String, block: () -> Unit) { private fun connectToServer(server: String, block: () -> Unit) {
if (!server.isValidUrl()) {
view.showInvalidServerUrlMessage()
} else {
launchUI(strategy) { launchUI(strategy) {
// Check if we already have an account for this server... // Check if we already have an account for this server...
val account = getAccountsInteractor.get().firstOrNull { it.serverUrl == server } val account = getAccountsInteractor.get().firstOrNull { it.serverUrl == server }
...@@ -53,5 +48,4 @@ class OnBoardingPresenter @Inject constructor( ...@@ -53,5 +48,4 @@ class OnBoardingPresenter @Inject constructor(
} }
} }
} }
}
} }
\ No newline at end of file
...@@ -3,10 +3,4 @@ package chat.rocket.android.authentication.onboarding.presentation ...@@ -3,10 +3,4 @@ package chat.rocket.android.authentication.onboarding.presentation
import chat.rocket.android.core.behaviours.LoadingView import chat.rocket.android.core.behaviours.LoadingView
import chat.rocket.android.core.behaviours.MessageView import chat.rocket.android.core.behaviours.MessageView
interface OnBoardingView : LoadingView, MessageView { interface OnBoardingView : LoadingView, MessageView
\ No newline at end of file
/**
* Shows an invalid server URL message.
*/
fun showInvalidServerUrlMessage()
}
\ No newline at end of file
package chat.rocket.android.authentication.onboarding.ui package chat.rocket.android.authentication.onboarding.ui
import android.os.Bundle import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import chat.rocket.android.R import chat.rocket.android.R
import chat.rocket.android.authentication.domain.model.getLoginDeepLinkInfo import chat.rocket.android.authentication.domain.model.getLoginDeepLinkInfo
import chat.rocket.android.authentication.onboarding.presentation.OnBoardingPresenter import chat.rocket.android.authentication.onboarding.presentation.OnBoardingPresenter
import chat.rocket.android.authentication.onboarding.presentation.OnBoardingView import chat.rocket.android.authentication.onboarding.presentation.OnBoardingView
import chat.rocket.android.authentication.server.ui.ServerFragment
import chat.rocket.android.authentication.ui.AuthenticationActivity import chat.rocket.android.authentication.ui.AuthenticationActivity
import chat.rocket.android.util.extensions.* import chat.rocket.android.util.extensions.inflate
import chat.rocket.android.util.extensions.setLightStatusBar
import chat.rocket.android.util.extensions.showToast
import chat.rocket.android.util.extensions.ui
import dagger.android.support.AndroidSupportInjection import dagger.android.support.AndroidSupportInjection
import kotlinx.android.synthetic.main.app_bar_chat_room.* import kotlinx.android.synthetic.main.app_bar_chat_room.*
import kotlinx.android.synthetic.main.fragment_authentication_on_boarding.* import kotlinx.android.synthetic.main.fragment_authentication_on_boarding.*
import javax.inject.Inject import javax.inject.Inject
class OnBoardingFragment : Fragment(), OnBoardingView { class OnBoardingFragment : Fragment(), OnBoardingView {
@Inject @Inject
lateinit var presenter: OnBoardingPresenter lateinit var presenter: OnBoardingPresenter
private var protocol = "https://"
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, override fun onCreate(savedInstanceState: Bundle?) {
savedInstanceState: Bundle?): View? = container?.inflate(R.layout.fragment_authentication_on_boarding) super.onCreate(savedInstanceState)
AndroidSupportInjection.inject(this)
}
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? = container?.inflate(R.layout.fragment_authentication_on_boarding)
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
setupOnClickListener()
setupToobar() setupToobar()
setupOnClickListener()
} }
private fun setupToobar() { private fun setupToobar() {
val toolbar = (activity as AuthenticationActivity).toolbar with(activity as AuthenticationActivity) {
view?.let { setLightStatusBar(it) }
toolbar.isVisible = false toolbar.isVisible = false
} }
}
private fun setupOnClickListener() { private fun setupOnClickListener() {
val deepLinkInfo = activity?.intent?.getLoginDeepLinkInfo() container_connect_with_a_server.setOnClickListener { connectWithAServer() }
button_connect_server.setOnClickListener {
(activity as AuthenticationActivity).addFragmentBackStack("ServerFragment", R.id.fragment_container) {
ServerFragment.newInstance(deepLinkInfo)
}
}
button_join_community.setOnClickListener {
connectToCommunityServer()
}
button_create_server.setOnClickListener {
presenter.createServer()
}
}
override fun onCreate(savedInstanceState: Bundle?) { container_join_community.setOnClickListener { joinInTheCommunity() }
super.onCreate(savedInstanceState)
AndroidSupportInjection.inject(this) container_create_server.setOnClickListener { createANewServer() }
} }
override fun showLoading() { override fun showLoading() {
ui{ ui {
view_loading.setVisible(true) view_loading.isVisible = true
} }
} }
override fun hideLoading() { override fun hideLoading() {
ui{ ui {
view_loading.setVisible(false) view_loading.isVisible = false
} }
} }
override fun showInvalidServerUrlMessage() = showMessage(getString(R.string.msg_invalid_server_url))
override fun showMessage(resId: Int) { override fun showMessage(resId: Int) {
ui { ui {
showToast(resId) showToast(resId)
...@@ -84,16 +79,26 @@ class OnBoardingFragment : Fragment(), OnBoardingView { ...@@ -84,16 +79,26 @@ class OnBoardingFragment : Fragment(), OnBoardingView {
} }
} }
override fun showGenericErrorMessage() { override fun showGenericErrorMessage() = showMessage(getString(R.string.msg_generic_error))
showMessage(getString(R.string.msg_generic_error))
private fun connectWithAServer() = ui {
presenter.toConnectWithAServer(activity?.intent?.getLoginDeepLinkInfo())
} }
private fun connectToCommunityServer() { private fun joinInTheCommunity() = ui {
ui { presenter.connectToCommunityServer(
val url = getString(R.string.community_server) getString(R.string.default_protocol) +
presenter.connect("$protocol${url.sanitize()}") getString(R.string.community_server_url)
)
} }
private fun createANewServer() = ui {
presenter.toCreateANewServer(
getString(R.string.default_protocol) +
getString(R.string.create_server_url)
)
} }
companion object { companion object {
fun newInstance() = OnBoardingFragment() fun newInstance() = OnBoardingFragment()
} }
......
...@@ -6,10 +6,13 @@ import chat.rocket.android.authentication.domain.model.LoginDeepLinkInfo ...@@ -6,10 +6,13 @@ import chat.rocket.android.authentication.domain.model.LoginDeepLinkInfo
import chat.rocket.android.authentication.login.ui.LoginFragment import chat.rocket.android.authentication.login.ui.LoginFragment
import chat.rocket.android.authentication.login.ui.TAG_LOGIN_FRAGMENT import chat.rocket.android.authentication.login.ui.TAG_LOGIN_FRAGMENT
import chat.rocket.android.authentication.loginoptions.ui.LoginOptionsFragment import chat.rocket.android.authentication.loginoptions.ui.LoginOptionsFragment
import chat.rocket.android.authentication.loginoptions.ui.TAG_LOGIN_OPTIONS
import chat.rocket.android.authentication.registerusername.ui.RegisterUsernameFragment import chat.rocket.android.authentication.registerusername.ui.RegisterUsernameFragment
import chat.rocket.android.authentication.registerusername.ui.TAG_REGISTER_USERNAME_FRAGMENT import chat.rocket.android.authentication.registerusername.ui.TAG_REGISTER_USERNAME_FRAGMENT
import chat.rocket.android.authentication.resetpassword.ui.ResetPasswordFragment import chat.rocket.android.authentication.resetpassword.ui.ResetPasswordFragment
import chat.rocket.android.authentication.resetpassword.ui.TAG_RESET_PASSWORD_FRAGMENT import chat.rocket.android.authentication.resetpassword.ui.TAG_RESET_PASSWORD_FRAGMENT
import chat.rocket.android.authentication.server.ui.ServerFragment
import chat.rocket.android.authentication.server.ui.TAG_SERVER_FRAGMENT
import chat.rocket.android.authentication.signup.ui.SignupFragment import chat.rocket.android.authentication.signup.ui.SignupFragment
import chat.rocket.android.authentication.signup.ui.TAG_SIGNUP_FRAGMENT import chat.rocket.android.authentication.signup.ui.TAG_SIGNUP_FRAGMENT
import chat.rocket.android.authentication.twofactor.ui.TAG_TWO_FA_FRAGMENT import chat.rocket.android.authentication.twofactor.ui.TAG_TWO_FA_FRAGMENT
...@@ -24,8 +27,14 @@ import chat.rocket.android.webview.ui.webViewIntent ...@@ -24,8 +27,14 @@ import chat.rocket.android.webview.ui.webViewIntent
class AuthenticationNavigator(internal val activity: AuthenticationActivity) { class AuthenticationNavigator(internal val activity: AuthenticationActivity) {
fun toConnectWithAServer(deepLinkInfo: LoginDeepLinkInfo?) {
activity.addFragmentBackStack(TAG_SERVER_FRAGMENT, R.id.fragment_container) {
ServerFragment.newInstance(deepLinkInfo)
}
}
fun toLoginOptions(server: String) { fun toLoginOptions(server: String) {
activity.addFragmentBackStack("LoginOptionFragment", R.id.fragment_container) { activity.addFragmentBackStack(TAG_LOGIN_OPTIONS, R.id.fragment_container) {
LoginOptionsFragment.newInstance(server) LoginOptionsFragment.newInstance(server)
} }
} }
...@@ -91,7 +100,7 @@ class AuthenticationNavigator(internal val activity: AuthenticationActivity) { ...@@ -91,7 +100,7 @@ class AuthenticationNavigator(internal val activity: AuthenticationActivity) {
} }
fun toCreateAccount() { fun toCreateAccount() {
activity.addFragmentBackStack("SignUpFragment", R.id.fragment_container){ activity.addFragmentBackStack("SignUpFragment", R.id.fragment_container) {
SignupFragment.newInstance() SignupFragment.newInstance()
} }
} }
......
...@@ -107,9 +107,11 @@ class ServerFragment : Fragment(), ServerView { ...@@ -107,9 +107,11 @@ class ServerFragment : Fragment(), ServerView {
} }
private fun setupToobar() { private fun setupToobar() {
val toolbar = (activity as AuthenticationActivity).toolbar with(activity as AuthenticationActivity) {
view?.let { setLightStatusBar(it) }
toolbar.isVisible = false toolbar.isVisible = false
} }
}
override fun onDestroyView() { override fun onDestroyView() {
super.onDestroyView() super.onDestroyView()
......
...@@ -3,6 +3,7 @@ package chat.rocket.android.util.extensions ...@@ -3,6 +3,7 @@ package chat.rocket.android.util.extensions
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.os.Build
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
...@@ -16,9 +17,25 @@ import androidx.annotation.StringRes ...@@ -16,9 +17,25 @@ import androidx.annotation.StringRes
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.view.SupportMenuInflater import androidx.appcompat.view.SupportMenuInflater
import androidx.appcompat.view.menu.MenuBuilder import androidx.appcompat.view.menu.MenuBuilder
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import chat.rocket.android.R import chat.rocket.android.R
fun AppCompatActivity.setLightStatusBar(view: View) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
var flags = view.systemUiVisibility
flags = flags or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
view.systemUiVisibility = flags
window.statusBarColor = ContextCompat.getColor(this, R.color.colorWhite)
}
}
fun AppCompatActivity.clearLightStatusBar(view: View) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
window.statusBarColor = ContextCompat.getColor(this, R.color.colorPrimary)
}
}
// TODO: Remove. Use KTX instead. // TODO: Remove. Use KTX instead.
fun View.setVisible(visible: Boolean) { fun View.setVisible(visible: Boolean) {
visibility = if (visible) { visibility = if (visible) {
...@@ -35,8 +52,10 @@ fun View.isVisible(): Boolean { ...@@ -35,8 +52,10 @@ fun View.isVisible(): Boolean {
fun ViewGroup.inflate(@LayoutRes resource: Int, attachToRoot: Boolean = false): View = fun ViewGroup.inflate(@LayoutRes resource: Int, attachToRoot: Boolean = false): View =
LayoutInflater.from(context).inflate(resource, this, attachToRoot) LayoutInflater.from(context).inflate(resource, this, attachToRoot)
fun AppCompatActivity.addFragment(tag: String, layoutId: Int, allowStateLoss: Boolean = false, fun AppCompatActivity.addFragment(
newInstance: () -> Fragment) { tag: String, layoutId: Int, allowStateLoss: Boolean = false,
newInstance: () -> Fragment
) {
val fragment = supportFragmentManager.findFragmentByTag(tag) ?: newInstance() val fragment = supportFragmentManager.findFragmentByTag(tag) ?: newInstance()
val transaction = supportFragmentManager.beginTransaction() val transaction = supportFragmentManager.beginTransaction()
.replace(layoutId, fragment, tag) .replace(layoutId, fragment, tag)
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
android:viewportHeight="30"> android:viewportHeight="30">
<path <path
android:strokeColor="#1D74F5" android:pathData="M13.086 8.636l4.242-4.243a5.5 5.5 0 0 1 7.779 7.779l-4.243 4.242a5.5 5.5 0 0 1-7.778 0"
android:strokeWidth="1.5" android:strokeWidth="1.5"
android:strokeLineCap="round" android:strokeColor="#FF000000"
android:pathData="M13.086 8.636l4.242-4.243a5.5 5.5 0 0 1 7.779 7.779l-4.243 4.242a5.5 5.5 0 0 1-7.778 0" /> android:strokeLineCap="round" />
<path <path
android:strokeColor="#1D74F5" android:pathData="M15.914 21.364l-4.242 4.243a5.5 5.5 0 0 1-7.779-7.779l4.243-4.242a5.5 5.5 0 0 1 7.778 0"
android:strokeWidth="1.5" android:strokeWidth="1.5"
android:strokeLineCap="round" android:strokeColor="#FF000000"
android:pathData="M15.914 21.364l-4.242 4.243a5.5 5.5 0 0 1-7.779-7.779l4.243-4.242a5.5 5.5 0 0 1 7.778 0" /> android:strokeLineCap="round" />
</vector> </vector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="31dp"
android:height="30dp"
android:viewportWidth="31"
android:viewportHeight="30">
<group
android:translateX="1"
android:translateY="2">
<path
android:fillColor="#C1262D"
android:pathData="M29.246 12.423c0-1.47-0.439-2.877-1.306-4.186-0.778-1.175-1.868-2.216-3.24-3.092-2.65-1.692-6.13-2.624-9.803-2.624a20.92 20.92 0 0 0-3.608 0.309 11.94 11.94 0 0 0-2.48-1.778C3.992-1.282 0 0.997 0 0.997s3.712 3.05 3.109 5.723C1.448 8.367 0.548 10.354 0.548 12.423v0.04c0 2.068 0.9 4.054 2.56 5.702C3.713 20.838 0 23.888 0 23.888s3.993 2.279 8.808-0.055a11.958 11.958 0 0 0 2.48-1.778c1.174 0.205 2.382 0.309 3.61 0.309 3.672 0 7.153-0.932 9.802-2.624 1.372-0.876 2.462-1.916 3.24-3.092 0.867 -1.309 1.306-2.717 1.306-4.185v-0.02-0.02z" />
<path
android:fillColor="#FFF"
android:pathData="M14.897 4.597c6.8 0 12.313 3.521 12.313 7.865 0 4.343-5.513 7.865-12.313 7.865-1.514 0-2.964-0.175-4.304-0.494-1.361 1.637-4.356 3.915-7.266 3.179 0.946 -1.017 2.348-2.734 2.048-5.564-1.744-1.357-2.79-3.093-2.79-4.986 0-4.344 5.512-7.865 12.312-7.865" />
<path
android:fillColor="#C1262D"
android:pathData="M 14.897 11.079 C 15.8005378507 11.079 16.533 11.8114621493 16.533 12.715 C 16.533 13.6185378507 15.8005378507 14.351 14.897 14.351 C 13.9934621493 14.351 13.261 13.6185378507 13.261 12.715 C 13.261 11.8114621493 13.9934621493 11.079 14.897 11.079 Z" />
<path
android:fillColor="#C1262D"
android:pathData="M 20.584 11.079 C 21.4875378507 11.079 22.22 11.8114621493 22.22 12.715 C 22.22 13.6185378507 21.4875378507 14.351 20.584 14.351 C 19.6804621493 14.351 18.948 13.6185378507 18.948 12.715 C 18.948 11.8114621493 19.6804621493 11.079 20.584 11.079 Z" />
<path
android:fillColor="#C1262D"
android:pathData="M 9.21 11.08 C 10.112985566 11.08 10.845 11.812014434 10.845 12.715 C 10.845 13.617985566 10.112985566 14.35 9.21 14.35 C 8.30701443403 14.35 7.575 13.617985566 7.575 12.715 C 7.575 11.812014434 8.30701443403 11.08 9.21 11.08 Z" />
<path
android:fillColor="#CCC"
android:pathData="M14.897 19.292c-1.514 0-2.964-0.152-4.304-0.429-1.202 1.254-3.678 2.939-6.244 2.877a9.71 9.71 0 0 1-1.022 1.271c2.91 0.736 5.905-1.54 7.266-3.179 1.34 0.32 2.79 0.495 4.304 0.495 6.746 0 12.223-3.466 12.31-7.761-0.087 3.723-5.564 6.726-12.31 6.726z" />
</group>
</vector>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="30dp"
android:height="30dp"
android:viewportWidth="30"
android:viewportHeight="30">
<path
android:fillType="nonZero"
android:pathData="M26.2984,12.2493L26.2989,12.2501C26.2988,12.2499 26.2987,12.2498 26.2987,12.2497C26.2986,12.2496 26.2985,12.2494 26.2984,12.2493ZM9.0351,3.1159C9.9595,3.6298 10.8333,4.2801 11.5795,5.0028C12.7824,4.7847 14.0227,4.6747 15.281,4.6747C19.0478,4.6747 22.6191,5.6639 25.3363,7.4593C26.7435,8.3896 27.8619,9.4933 28.6603,10.7402C29.5493,12.1296 30,13.6236 30,15.2246C30,16.7824 29.5493,18.2771 28.6603,19.6662C27.8619,20.9137 26.7435,22.0171 25.3363,22.9474C22.6191,24.7428 19.0481,25.7314 15.281,25.7314C14.0227,25.7314 12.7827,25.6214 11.5795,25.4036C10.833,26.126 9.9595,26.7765 9.0351,27.2905C4.0959,29.7665 0,27.3487 0,27.3487C0,27.3487 3.8081,24.1124 3.1889,21.2755C1.485,19.5274 0.5618,17.419 0.5618,15.1821C0.5618,12.9873 1.4853,10.879 3.1889,9.1306C3.808,6.2944 0.0013,3.0587 0,3.0577C0.0012,3.057 4.0966,0.6399 9.0351,3.1159Z"
android:strokeWidth="1"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:endX="15"
android:endY="25.305122"
android:startX="15"
android:startY="-1.2754043"
android:type="linear">
<item
android:color="#FFDB2323"
android:offset="0" />
<item
android:color="#FFDB2323"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M5.9908,19.9981C4.2976,18.6585 3.2813,16.9442 3.2813,15.0757C3.2813,10.7882 8.6328,7.3125 15.2344,7.3125C21.8359,7.3125 27.1875,10.7882 27.1875,15.0757C27.1875,19.3632 21.8359,22.8389 15.2344,22.8389C13.6074,22.8389 12.0563,22.6278 10.6425,22.2454L9.6089,23.2462C9.0473,23.79 8.3891,24.2821 7.7029,24.6698C6.7935,25.1182 5.8954,25.3629 5.0068,25.4375C5.057,25.346 5.1031,25.2533 5.1527,25.1617C6.1883,23.2464 6.4677,21.5252 5.9908,19.9981Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
<path
android:fillType="nonZero"
android:pathData="M9.5313,15.125m-1.7188,0a1.7188,1.7188 0,1 1,3.4375 0a1.7188,1.7188 0,1 1,-3.4375 0"
android:strokeWidth="1"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:endX="9.53125"
android:endY="16.345976"
android:startX="9.53125"
android:startY="13.133343"
android:type="linear">
<item
android:color="#FFDB2323"
android:offset="0" />
<item
android:color="#FFDB2323"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path
android:fillType="nonZero"
android:pathData="M15.1563,15.125m-1.7188,0a1.7188,1.7188 0,1 1,3.4375 0a1.7188,1.7188 0,1 1,-3.4375 0"
android:strokeWidth="1"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:endX="15.15625"
android:endY="16.345972"
android:startX="15.15625"
android:startY="13.133308"
android:type="linear">
<item
android:color="#FFDB2323"
android:offset="0" />
<item
android:color="#FFDB2323"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path
android:fillType="nonZero"
android:pathData="M20.9375,15.125m-1.7188,0a1.7188,1.7188 0,1 1,3.4375 0a1.7188,1.7188 0,1 1,-3.4375 0"
android:strokeWidth="1"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:endX="20.93745"
android:endY="16.345972"
android:startX="20.93745"
android:startY="13.133308"
android:type="linear">
<item
android:color="#FFDB2323"
android:offset="0" />
<item
android:color="#FFDB2323"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
</vector>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<stroke android:width="1dp" android:color="#e1e5e8" />
<stroke
android:width="1dp"
android:color="@color/colorAuthenticationOnBoardingButtonBorder" />
<corners android:radius="2dp" /> <corners android:radius="2dp" />
</shape> </shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<solid android:color="@color/colorAccent" /> <solid android:color="@color/colorAccent" />
<corners android:radius="2dp"/>
<corners android:radius="2dp" />
</shape> </shape>
\ No newline at end of file
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/color_white" android:background="@color/color_white"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="chat.rocket.android.authentication.loginoptions.ui.LoginOptionsFragment"> tools:context="chat.rocket.android.authentication.loginoptions.ui.LoginOptionsFragment">
<Button <Button
android:id="@+id/button_facebook" android:id="@+id/button_facebook"
style="?borderlessButtonStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="48dp" android:layout_height="48dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@drawable/rounded_border"
android:foreground="?selectableItemBackground"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="32dp" android:layout_marginTop="32dp"
android:layout_marginEnd="16dp"
android:background="@drawable/rounded_border"
android:drawableStart="@drawable/ic_facebook_24dp" android:drawableStart="@drawable/ic_facebook_24dp"
android:foreground="?selectableItemBackground"
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:text="@string/msg_continue_with_facebook" android:text="@string/msg_continue_with_facebook"
android:textAllCaps="false"
android:textColor="#2f343d" android:textColor="#2f343d"
android:textSize="16sp" android:textSize="16sp"
android:textAllCaps="false" app:layout_constraintEnd_toEndOf="parent"
style="?borderlessButtonStyle" /> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button <Button
android:id="@+id/button_github" android:id="@+id/button_github"
style="?borderlessButtonStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="48dp" android:layout_height="48dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_facebook"
android:background="@drawable/rounded_border"
android:foreground="?selectableItemBackground"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
android:background="@drawable/rounded_border"
android:drawableStart="@drawable/ic_github_24dp" android:drawableStart="@drawable/ic_github_24dp"
android:foreground="?selectableItemBackground"
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:text="@string/msg_continue_with_github" android:text="@string/msg_continue_with_github"
android:textAllCaps="false"
android:textColor="#2f343d" android:textColor="#2f343d"
android:textSize="16sp" android:textSize="16sp"
android:textAllCaps="false" app:layout_constraintEnd_toEndOf="parent"
style="?borderlessButtonStyle" /> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_facebook" />
<Button <Button
android:id="@+id/button_google" android:id="@+id/button_google"
style="?borderlessButtonStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="48dp" android:layout_height="48dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_github"
android:background="@drawable/rounded_border"
android:foreground="?selectableItemBackground"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
android:background="@drawable/rounded_border"
android:drawableStart="@drawable/ic_google_24dp" android:drawableStart="@drawable/ic_google_24dp"
android:foreground="?selectableItemBackground"
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:text="@string/msg_continue_with_google" android:text="@string/msg_continue_with_google"
android:textAllCaps="false"
android:textColor="#2f343d" android:textColor="#2f343d"
android:textSize="16sp" android:textSize="16sp"
android:textAllCaps="false" app:layout_constraintEnd_toEndOf="parent"
style="?borderlessButtonStyle" /> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_github" />
<Button <Button
android:id="@+id/button_linkedin" android:id="@+id/button_linkedin"
style="?borderlessButtonStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="48dp" android:layout_height="48dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_google"
android:background="@drawable/rounded_border"
android:foreground="?selectableItemBackground"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
android:background="@drawable/rounded_border"
android:drawableStart="@drawable/ic_linkedin_24dp" android:drawableStart="@drawable/ic_linkedin_24dp"
android:foreground="?selectableItemBackground"
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:text="@string/msg_continue_with_linkedin" android:text="@string/msg_continue_with_linkedin"
android:textAllCaps="false"
android:textColor="#2f343d" android:textColor="#2f343d"
android:textSize="16sp" android:textSize="16sp"
android:textAllCaps="false"
style="?borderlessButtonStyle"
android:visibility="gone" android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_google"
tools:visibility="visible" /> tools:visibility="visible" />
<Button <Button
android:id="@+id/button_gitlab" android:id="@+id/button_gitlab"
style="?borderlessButtonStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="48dp" android:layout_height="48dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_linkedin"
android:background="@drawable/rounded_border"
android:foreground="?selectableItemBackground"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
android:background="@drawable/rounded_border"
android:drawableStart="@drawable/ic_gitlab_24dp" android:drawableStart="@drawable/ic_gitlab_24dp"
android:foreground="?selectableItemBackground"
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:text="@string/msg_continue_with_gitlab" android:text="@string/msg_continue_with_gitlab"
android:textAllCaps="false"
android:textColor="#2f343d" android:textColor="#2f343d"
android:textSize="16sp" android:textSize="16sp"
android:textAllCaps="false"
style="?borderlessButtonStyle"
android:visibility="gone" android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_linkedin"
tools:visibility="visible" /> tools:visibility="visible" />
<ImageView <ImageView
android:id="@+id/image_more_login_option" android:id="@+id/image_more_login_option"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
app:layout_constraintTop_toBottomOf="@id/button_gitlab"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:background="@drawable/circle_background_grey"
android:src="@drawable/ic_expand_more_black_24dp" android:src="@drawable/ic_expand_more_black_24dp"
android:tint="#fff" android:tint="#fff"
android:background="@drawable/circle_background_grey" /> app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_gitlab" />
<View <View
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="1dp" android:layout_height="1dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/image_more_login_option"
app:layout_constraintTop_toTopOf="@id/image_more_login_option"
app:layout_constraintBottom_toBottomOf="@id/image_more_login_option"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:background="#e1e5e8" /> android:background="#e1e5e8"
app:layout_constraintBottom_toBottomOf="@id/image_more_login_option"
app:layout_constraintEnd_toStartOf="@id/image_more_login_option"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/image_more_login_option" />
<View <View
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="1dp" android:layout_height="1dp"
app:layout_constraintTop_toTopOf="@id/image_more_login_option"
app:layout_constraintBottom_toBottomOf="@id/image_more_login_option"
app:layout_constraintStart_toEndOf="@id/image_more_login_option"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:background="#e1e5e8" /> android:background="#e1e5e8"
app:layout_constraintBottom_toBottomOf="@id/image_more_login_option"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/image_more_login_option"
app:layout_constraintTop_toTopOf="@id/image_more_login_option" />
<Button <Button
android:id="@+id/button_login" android:id="@+id/button_login"
style="@style/Authentication.Button" style="@style/Authentication.Button"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/image_more_login_option"
android:layout_marginTop="32dp" android:layout_marginTop="32dp"
android:text="@string/msg_login_with_email" /> android:text="@string/msg_login_with_email"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/image_more_login_option" />
<Button <Button
android:id="@+id/button_create_account" android:id="@+id/button_create_account"
style="?borderlessButtonStyle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="48dp" android:layout_height="48dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_login"
style="?borderlessButtonStyle"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:text="@string/msg_create_account" android:text="@string/msg_create_account"
android:textAllCaps="false"
android:textColor="@color/colorAccent"
android:textSize="18sp" android:textSize="18sp"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@color/colorAccent" app:layout_constraintEnd_toEndOf="parent"
android:textAllCaps="false" /> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_login" />
<com.wang.avi.AVLoadingIndicatorView <com.wang.avi.AVLoadingIndicatorView
android:id="@+id/view_loading" android:id="@+id/view_loading"
style="@style/Authentication.AVLoadingIndicatorView" style="@style/Authentication.AVLoadingIndicatorView"
app:layout_constraintStart_toStartOf="parent" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:visibility="gone"
tools:visibility="visible" /> tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/colorWhite" android:background="@color/colorWhite"
tools:context="chat.rocket.android.authentication.onboarding.ui.OnBoardingFragment"> android:padding="@dimen/screen_edge_left_and_right_margins"
tools:context="authentication.onboarding.ui.OnBoardingFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="40dp"
android:paddingBottom="40dp">
<ImageView <ImageView
android:id="@+id/image_on_boarding" android:id="@+id/image_on_boarding"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:src="@drawable/ic_onboarding" android:src="@drawable/ic_onboarding"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
<TextView <TextView
android:id="@+id/text_onboarding_title" android:id="@+id/text_on_boarding_title"
style="@style/Authentication.Headline.TextView" style="@style/Authentication.Headline.TextView"
android:layout_marginTop="32dp"
android:text="@string/msg_welcome_to_rocket_chat" android:text="@string/msg_welcome_to_rocket_chat"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/image_on_boarding" app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="32dp" /> app:layout_constraintTop_toBottomOf="@+id/image_on_boarding" />
<TextView <TextView
android:id="@+id/text_onboarding_description" android:id="@+id/text_on_boarding_description"
style="@style/Authentication.Description.TextView" style="@style/Authentication.Description.TextView"
android:text="@string/msg_open_source_communication" android:text="@string/msg_open_source_communication"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_onboarding_title" app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="8dp"/> app:layout_constraintTop_toBottomOf="@+id/text_on_boarding_title" />
<RelativeLayout <RelativeLayout
android:id="@+id/button_connect_server" android:id="@+id/container_connect_with_a_server"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="60dp" android:layout_height="60dp"
app:layout_constraintStart_toStartOf="parent" android:layout_marginTop="32dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_onboarding_description"
android:layout_marginTop="48dp"
android:background="@drawable/rounded_border" android:background="@drawable/rounded_border"
android:foreground="?selectableItemBackground" android:foreground="?selectableItemBackground"
android:layout_marginStart="16dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="16dp" app:layout_constraintStart_toStartOf="parent"
> app:layout_constraintTop_toBottomOf="@+id/text_on_boarding_description">
<ImageView <ImageView
android:id="@+id/image_connect_server" android:id="@+id/image_connect_with_a_server"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:src="@drawable/ic_connect_server_30dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginStart="15dp" android:layout_marginStart="16dp"
android:layout_marginEnd="20dp"/> android:layout_marginEnd="20dp"
android:src="@drawable/ic_connect_with_a_server_black_30dp"
android:tint="@color/colorAccent"
tools:ignore="ContentDescription" />
<TextView <TextView
style="@style/Authentication.OnBoarding.Button.Title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="17sp"
android:fontFamily="sans-serif"
android:textStyle="bold"
android:textColor="#1d74f5"
android:letterSpacing="0.04"
android:text="@string/action_connect_server"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_toEndOf="@id/image_connect_server" /> android:layout_toStartOf="@+id/image_connect_with_a_server_chevron"
android:layout_toEndOf="@+id/image_connect_with_a_server"
android:text="@string/action_connect_server" />
<ImageView <ImageView
android:id="@+id/image_connect_with_a_server_chevron"
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:src="@drawable/ic_chevron_right_black_24dp" android:src="@drawable/ic_chevron_right_black_24dp"
android:tint="#CBCED1"/> android:tint="@color/colorAuthenticationOnBoardingChevron"
tools:ignore="ContentDescription" />
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/button_join_community" android:id="@+id/container_join_community"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="60dp" android:layout_height="60dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_connect_server"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:background="@drawable/rounded_border" android:background="@drawable/rounded_border"
android:foreground="?selectableItemBackground" android:foreground="?selectableItemBackground"
android:layout_marginStart="16dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="16dp" app:layout_constraintStart_toStartOf="parent"
> app:layout_constraintTop_toBottomOf="@+id/container_connect_with_a_server">
<ImageView <ImageView
android:id="@+id/image_join_community" android:id="@+id/image_join_community"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:src="@drawable/ic_rocket_chat"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginStart="15dp" android:layout_marginStart="16dp"
android:layout_marginEnd="20dp"/> android:layout_marginEnd="20dp"
android:src="@drawable/ic_rocket_chat_30dp"
tools:ignore="ContentDescription" />
<TextView <TextView
android:id="@+id/text_join_community" android:id="@+id/text_join_community"
style="@style/Authentication.OnBoarding.Button.Title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="17sp"
android:fontFamily="sans-serif"
android:textStyle="bold"
android:textColor="#1d74f5"
android:letterSpacing="0.04"
android:text="@string/action_join_community"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_toEndOf="@id/image_join_community" /> android:layout_toStartOf="@+id/image_join_community_chevron"
android:layout_toEndOf="@+id/image_join_community"
android:text="@string/action_join_community" />
<TextView <TextView
style="@style/Authentication.OnBoarding.Button.Description"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="15sp" android:layout_below="@+id/text_join_community"
android:fontFamily="sans-serif" android:layout_toStartOf="@+id/image_join_community_chevron"
android:textStyle="normal" android:layout_toEndOf="@+id/image_join_community"
android:textColor="#9ea2a8" android:text="@string/community_server_url" />
android:letterSpacing="0.04"
android:text="@string/community_server"
android:layout_below="@id/text_join_community"
android:layout_toEndOf="@id/image_join_community"/>
<ImageView <ImageView
android:id="@+id/image_join_community_chevron"
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:src="@drawable/ic_chevron_right_black_24dp" android:src="@drawable/ic_chevron_right_black_24dp"
android:tint="#CBCED1"/> android:tint="@color/colorAuthenticationOnBoardingChevron"
tools:ignore="ContentDescription" />
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/button_create_server" android:id="@+id/container_create_server"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="60dp" android:layout_height="60dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_join_community"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="@drawable/rounded_color_accent" android:background="@drawable/rounded_color_accent"
android:foreground="?selectableItemBackground"> android:foreground="?selectableItemBackground"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/container_join_community">
<ImageView <ImageView
android:id="@+id/image_new_server" android:id="@+id/image_add"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_centerVertical="true"
android:layout_marginStart="16dp"
android:layout_marginEnd="20dp"
android:src="@drawable/ic_add_24dp" android:src="@drawable/ic_add_24dp"
android:tint="@color/colorWhite" android:tint="@color/colorWhite"
android:layout_centerVertical="true" tools:ignore="ContentDescription" />
android:layout_marginStart="15dp"
android:layout_marginEnd="20dp"/>
<TextView <TextView
style="@style/Authentication.OnBoarding.Button.Title.White"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="17sp"
android:fontFamily="sans-serif"
android:textStyle="bold"
android:textColor="#fff"
android:letterSpacing="0.04"
android:text="@string/action_create_server"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_toEndOf="@id/image_new_server" /> android:layout_toEndOf="@+id/image_add"
android:text="@string/action_create_server" />
</RelativeLayout> </RelativeLayout>
<com.wang.avi.AVLoadingIndicatorView <com.wang.avi.AVLoadingIndicatorView
android:id="@+id/view_loading" android:id="@+id/view_loading"
style="@style/Authentication.AVLoadingIndicatorView" style="@style/Authentication.AVLoadingIndicatorView"
app:layout_constraintStart_toStartOf="parent" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" tools:visibility="gone" />
android:visibility="gone" </androidx.constraintlayout.widget.ConstraintLayout>
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<!-- Main colors --> <!-- Main colors -->
<color name="colorPrimary">#2f343d</color> <color name="colorPrimary">#2f343d</color>
<color name="colorPrimaryDark">#2f343d</color> <color name="colorPrimaryDark">#2f343d</color>
<color name="colorAccent">#1d74f5</color> <color name="colorAccent">#FF1D74F5</color>
<!-- Text colors --> <!-- Text colors -->
<color name="colorPrimaryText">#DE000000</color> <color name="colorPrimaryText">#DE000000</color>
...@@ -22,6 +22,11 @@ ...@@ -22,6 +22,11 @@
<color name="colorBlack">#FF000000</color> <color name="colorBlack">#FF000000</color>
<color name="colorRed">#FFFF0000</color> <color name="colorRed">#FFFF0000</color>
<!-- Authentication colors -->
<color name="colorAuthenticationOnBoardingButtonBorder">#FFE1E5E8</color>
<color name="colorAuthenticationOnBoardingChevron">#FFCBCED1</color>
<color name="colorAuthenticationOnBoardingTextDescription">#FF9EA2A8</color>
<color name="darkGray">#FFa0a0a0</color> <color name="darkGray">#FFa0a0a0</color>
<color name="actionMenuColor">#FF727272</color> <color name="actionMenuColor">#FF727272</color>
<color name="whitesmoke">#FFf1f1f1</color> <color name="whitesmoke">#FFf1f1f1</color>
......
...@@ -2,4 +2,6 @@ ...@@ -2,4 +2,6 @@
<resources> <resources>
<string name="default_protocol" translatable="false">https://</string> <string name="default_protocol" translatable="false">https://</string>
<string name="default_server" translatable="false">open.rocket.chat</string> <string name="default_server" translatable="false">open.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> </resources>
\ No newline at end of file
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
<string name="msg_invalid_2fa_code">Invalid 2FA Code</string> <string name="msg_invalid_2fa_code">Invalid 2FA Code</string>
<string name="msg_invalid_file">Invalid file</string> <string name="msg_invalid_file">Invalid file</string>
<string name="msg_invalid_server_url">Invalid server URL</string> <string name="msg_invalid_server_url">Invalid server URL</string>
<string name="msg_content_description_onboarding">Onboarding image</string>
<string name="msg_content_description_log_in_using_facebook">Login using Facebook</string> <string name="msg_content_description_log_in_using_facebook">Login using Facebook</string>
<string name="msg_content_description_log_in_using_github">Login using Github</string> <string name="msg_content_description_log_in_using_github">Login using Github</string>
<string name="msg_content_description_log_in_using_google">Login using Google</string> <string name="msg_content_description_log_in_using_google">Login using Google</string>
...@@ -306,6 +307,7 @@ ...@@ -306,6 +307,7 @@
<string name="message_information_title">Message information</string> <string name="message_information_title">Message information</string>
<string name="foss" tools:ignore="MissingTranslation">(FOSS)</string> <string name="foss" tools:ignore="MissingTranslation">(FOSS)</string>
<!-- Community Server--> <!-- Community Server-->
<string name="community_server" translatable="false">open.rocket.chat</string>
</resources> </resources>
\ No newline at end of file
...@@ -26,8 +26,9 @@ ...@@ -26,8 +26,9 @@
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>
<item name="android:textSize">22sp</item> <item name="android:textSize">22sp</item>
<item name="android:lineSpacingExtra">4sp</item>
<item name="android:fontFamily">sans-serif</item> <item name="android:fontFamily">sans-serif</item>
<item name="android:textColor">#2f343d</item> <item name="android:textColor">#FF2F343D</item>
<item name="android:textStyle">bold</item> <item name="android:textStyle">bold</item>
</style> </style>
...@@ -35,8 +36,31 @@ ...@@ -35,8 +36,31 @@
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>
<item name="android:textSize">16sp</item> <item name="android:textSize">16sp</item>
<item name="android:textColor">#54585e</item> <item name="android:fontFamily">sans-serif</item>
<item name="android:lineSpacingExtra">4sp</item>
<item name="android:textColor">#FF54585E</item>
<item name="android:textStyle">normal</item>
</style>
<!-- OnBoarding -->
<style name="Authentication.OnBoarding.Button.Title" parent="TextAppearance.AppCompat">
<item name="android:textSize">17sp</item>
<item name="android:fontFamily">sans-serif</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@color/colorAccent</item>
<item name="android:letterSpacing">0.04</item>
</style>
<style name="Authentication.OnBoarding.Button.Title.White" parent="Authentication.OnBoarding.Button.Title">
<item name="android:textColor">@color/colorWhite</item>
</style>
<style name="Authentication.OnBoarding.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:letterSpacing">0.04</item>
</style> </style>
<style name="Authentication.EditText" parent="Widget.AppCompat.EditText"> <style name="Authentication.EditText" parent="Widget.AppCompat.EditText">
......
{
"formatVersion": 1,
"database": {
"version": 1,
"identityHash": "5d591429a85289a5fe608ab2c4d77b0b",
"entities": [
{
"tableName": "Emoji",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`shortname` TEXT NOT NULL, `shortnameAlternates` TEXT NOT NULL, `unicode` TEXT NOT NULL, `category` TEXT NOT NULL, `count` INTEGER NOT NULL, `siblings` TEXT NOT NULL, `fitzpatrick` TEXT NOT NULL, `url` TEXT, `isDefault` INTEGER NOT NULL, PRIMARY KEY(`shortname`))",
"fields": [
{
"fieldPath": "shortname",
"columnName": "shortname",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "shortnameAlternates",
"columnName": "shortnameAlternates",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "unicode",
"columnName": "unicode",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "category",
"columnName": "category",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "count",
"columnName": "count",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "siblings",
"columnName": "siblings",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "fitzpatrick",
"columnName": "fitzpatrick",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "isDefault",
"columnName": "isDefault",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"shortname"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
}
],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"5d591429a85289a5fe608ab2c4d77b0b\")"
]
}
}
\ No newline at end of file
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