Started login/create account

This commit is contained in:
Sylvain Berfini 2023-08-11 17:54:17 +02:00
parent a23ffdcd1f
commit 1901a8535a
16 changed files with 861 additions and 3 deletions

View file

@ -30,6 +30,11 @@
</activity>
<activity
android:name=".ui.assistant.AssistantActivity"
android:launchMode="singleTask"
android:resizeableActivity="true" />
<activity
android:name=".ui.voip.VoipActivity"
android:launchMode="singleTask"

View file

@ -0,0 +1,50 @@
/*
* Copyright (c) 2010-2023 Belledonne Communications SARL.
*
* This file is part of linphone-android
* (see https://www.linphone.org).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.linphone.ui.assistant
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.core.view.WindowCompat
import androidx.databinding.DataBindingUtil
import org.linphone.LinphoneApplication
import org.linphone.R
import org.linphone.databinding.AssistantActivityBinding
class AssistantActivity : AppCompatActivity() {
private lateinit var binding: AssistantActivityBinding
override fun onCreate(savedInstanceState: Bundle?) {
WindowCompat.setDecorFitsSystemWindows(window, true)
super.onCreate(savedInstanceState)
window.statusBarColor = ContextCompat.getColor(
this,
R.color.primary_color
)
while (!LinphoneApplication.coreContext.isReady()) {
Thread.sleep(20)
}
binding = DataBindingUtil.setContentView(this, R.layout.assistant_activity)
binding.lifecycleOwner = this
}
}

View file

@ -0,0 +1,56 @@
/*
* Copyright (c) 2010-2023 Belledonne Communications SARL.
*
* This file is part of linphone-android
* (see https://www.linphone.org).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.linphone.ui.assistant.fragment
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.navigation.fragment.findNavController
import org.linphone.databinding.AssistantLoginFragmentBinding
import org.linphone.ui.main.fragment.GenericFragment
class LoginFragment : GenericFragment() {
private lateinit var binding: AssistantLoginFragmentBinding
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
binding = AssistantLoginFragmentBinding.inflate(layoutInflater)
return binding.root
}
override fun goBack() {
requireActivity().finish()
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.lifecycleOwner = viewLifecycleOwner
binding.setRegisterClickListener {
val action = LoginFragmentDirections.actionLoginFragmentToRegisterFragment()
findNavController().navigate(action)
}
}
}

View file

@ -0,0 +1,55 @@
/*
* Copyright (c) 2010-2023 Belledonne Communications SARL.
*
* This file is part of linphone-android
* (see https://www.linphone.org).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.linphone.ui.assistant.fragment
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.navigation.fragment.findNavController
import org.linphone.databinding.AssistantRegisterFragmentBinding
import org.linphone.ui.main.fragment.GenericFragment
class RegisterFragment : GenericFragment() {
private lateinit var binding: AssistantRegisterFragmentBinding
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
binding = AssistantRegisterFragmentBinding.inflate(layoutInflater)
return binding.root
}
override fun goBack() {
findNavController().popBackStack()
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.lifecycleOwner = viewLifecycleOwner
binding.setLoginClickListener {
goBack()
}
}
}

View file

@ -20,6 +20,7 @@
package org.linphone.ui.main
import android.Manifest
import android.content.Intent
import android.content.pm.PackageManager
import android.os.Bundle
import android.view.Gravity
@ -27,9 +28,12 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.core.view.WindowCompat
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.ViewModelProvider
import org.linphone.LinphoneApplication.Companion.coreContext
import org.linphone.R
import org.linphone.databinding.MainActivityBinding
import org.linphone.ui.assistant.AssistantActivity
import org.linphone.ui.main.viewmodel.DrawerMenuViewModel
class MainActivity : AppCompatActivity() {
companion object {
@ -39,6 +43,7 @@ class MainActivity : AppCompatActivity() {
}
private lateinit var binding: MainActivityBinding
private lateinit var drawerMenuViewModel: DrawerMenuViewModel
override fun onCreate(savedInstanceState: Bundle?) {
WindowCompat.setDecorFitsSystemWindows(window, true)
@ -61,6 +66,17 @@ class MainActivity : AppCompatActivity() {
binding = DataBindingUtil.setContentView(this, R.layout.main_activity)
binding.lifecycleOwner = this
drawerMenuViewModel = run {
ViewModelProvider(this)[DrawerMenuViewModel::class.java]
}
binding.drawerMenuViewModel = drawerMenuViewModel
drawerMenuViewModel.startAssistantEvent.observe(this) {
it.consume {
startActivity(Intent(baseContext, AssistantActivity::class.java))
}
}
}
override fun onPostCreate(savedInstanceState: Bundle?) {

View file

@ -0,0 +1,36 @@
/*
* Copyright (c) 2010-2023 Belledonne Communications SARL.
*
* This file is part of linphone-android
* (see https://www.linphone.org).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.linphone.ui.main.viewmodel
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import org.linphone.utils.Event
class DrawerMenuViewModel : ViewModel() {
val startAssistantEvent: MutableLiveData<Event<Boolean>> by lazy {
MutableLiveData<Event<Boolean>>()
}
fun addAccount() {
// UI thread
startAssistantEvent.value = Event(true)
}
}

View file

@ -48,7 +48,7 @@ class VoipActivity : AppCompatActivity() {
this,
R.color.in_call_black
)
window.statusBarColor = inCallBlackColor
// window.statusBarColor = inCallBlackColor
window.navigationBarColor = inCallBlackColor
while (!LinphoneApplication.coreContext.isReady()) {

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<corners android:radius="63dp" />
<solid android:color="@color/gray_7"/>
<stroke android:width="1dp" android:color="@color/gray_6" />
</shape>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<corners android:radius="48dp" />
<solid android:color="@color/primary_color"/>
</shape>

View file

@ -0,0 +1,13 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="vector"
android:width="16dp"
android:height="17dp"
android:viewportWidth="16"
android:viewportHeight="17">
<path
android:name="path"
android:pathData="M 8 4.833 C 10.527 4.833 12.78 6.253 13.88 8.5 C 12.78 10.747 10.527 12.167 8 12.167 C 5.473 12.167 3.22 10.747 2.12 8.5 C 3.22 6.253 5.473 4.833 8 4.833 Z M 8 3.5 C 4.667 3.5 1.82 5.573 0.667 8.5 C 1.82 11.427 4.667 13.5 8 13.5 C 11.333 13.5 14.18 11.427 15.333 8.5 C 14.18 5.573 11.333 3.5 8 3.5 Z M 8 6.833 C 8.92 6.833 9.667 7.58 9.667 8.5 C 9.667 9.42 8.92 10.167 8 10.167 C 7.08 10.167 6.333 9.42 6.333 8.5 C 6.333 7.58 7.08 6.833 8 6.833 Z M 8 5.5 C 6.347 5.5 5 6.847 5 8.5 C 5 10.153 6.347 11.5 8 11.5 C 9.653 11.5 11 10.153 11 8.5 C 11 6.847 9.653 5.5 8 5.5 Z"
android:fillColor="#6c7a87"
android:strokeWidth="1"/>
</vector>

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.voip.VoipActivity">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/assistant_nav_container"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:navGraph="@navigation/assistant_nav_graph"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

View file

@ -0,0 +1,298 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<variable
name="registerClickListener"
type="View.OnClickListener" />
</data>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_800"
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
android:text="Login"
android:textSize="20sp"
android:textColor="@color/gray_9"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/username_label"
style="@style/default_text_style_700"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="48dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="Username*"
android:textSize="13sp"
android:textColor="@color/gray_9"
app:layout_constraintTop_toBottomOf="@id/title"
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatEditText
style="@style/default_text_style"
android:id="@+id/username"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="John Doe"
android:textSize="14sp"
android:textColor="@color/gray_9"
android:background="@drawable/shape_edit_text_background"
app:layout_constraintTop_toBottomOf="@id/username_label"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/password_label"
style="@style/default_text_style_700"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:text="Password*"
android:textSize="13sp"
android:textColor="@color/gray_9"
app:layout_constraintTop_toBottomOf="@id/username"
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatEditText
style="@style/default_text_style"
android:id="@+id/password"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="John Doe"
android:textSize="14sp"
android:textColor="@color/gray_9"
android:background="@drawable/shape_edit_text_background"
android:inputType="textPassword"
android:drawableEnd="@drawable/show_password"
android:drawableTint="@color/gray_1"
app:layout_constraintTop_toBottomOf="@id/password_label"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<ImageView
android:id="@+id/login_background"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:src="@drawable/shape_orange_filled_button_background"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/login"
app:layout_constraintBottom_toBottomOf="@id/login" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_600"
android:id="@+id/login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:paddingTop="13dp"
android:paddingBottom="13dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="Login"
android:textSize="18sp"
android:textColor="@color/white"
android:gravity="center_vertical"
app:layout_constraintTop_toBottomOf="@id/password"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_600"
android:id="@+id/forgotten_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:paddingTop="13dp"
android:paddingBottom="13dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="Forgotten password?"
android:textSize="13sp"
android:textColor="@color/gray_1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/login"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/or"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="28dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:text="or"
android:textSize="14sp"
android:textColor="@color/gray_1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/forgotten_password"/>
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginStart="16dp"
android:background="@color/blue_outgoing_message"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/or"
app:layout_constraintTop_toTopOf="@id/or"
app:layout_constraintBottom_toBottomOf="@id/or"/>
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginEnd="16dp"
android:background="@color/blue_outgoing_message"
app:layout_constraintStart_toEndOf="@id/or"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/or"
app:layout_constraintBottom_toBottomOf="@id/or"/>
<ImageView
android:id="@+id/scan_qr_code_background"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:src="@drawable/shape_orange_outlined_button_background"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/scan_qr_code"
app:layout_constraintBottom_toBottomOf="@id/scan_qr_code" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_600"
android:id="@+id/scan_qr_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="22dp"
android:paddingTop="13dp"
android:paddingBottom="13dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="Scan QR code"
android:textSize="18sp"
android:textColor="@color/primary_color"
android:gravity="center_vertical"
android:drawableStart="@drawable/invite"
android:drawablePadding="8dp"
app:drawableTint="@color/primary_color"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/or" />
<ImageView
android:id="@+id/third_party_sip_account_background"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:src="@drawable/shape_orange_outlined_button_background"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/third_party_sip_account"
app:layout_constraintBottom_toBottomOf="@id/third_party_sip_account" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_600"
android:id="@+id/third_party_sip_account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:paddingTop="13dp"
android:paddingBottom="13dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="Use third party SIP account"
android:textSize="18sp"
android:textColor="@color/primary_color"
android:gravity="center_vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/scan_qr_code" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/no_account_yet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="13dp"
android:paddingBottom="13dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="No account yet?"
android:textSize="14sp"
android:textColor="@color/gray_8"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/register"
app:layout_constraintTop_toTopOf="@id/register"
app:layout_constraintBottom_toBottomOf="@id/register"/>
<ImageView
android:id="@+id/register_background"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/shape_orange_outlined_button_background"
app:layout_constraintStart_toStartOf="@id/register"
app:layout_constraintEnd_toEndOf="@id/register"
app:layout_constraintTop_toTopOf="@id/register"
app:layout_constraintBottom_toBottomOf="@id/register" />
<androidx.appcompat.widget.AppCompatTextView
android:onClick="@{registerClickListener}"
style="@style/default_text_style_600"
android:id="@+id/register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:layout_marginStart="20dp"
android:layout_marginBottom="20dp"
android:paddingTop="13dp"
android:paddingBottom="13dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="Register"
android:textSize="18sp"
android:textColor="@color/primary_color"
android:gravity="center_vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/no_account_yet"
app:layout_constraintTop_toBottomOf="@id/third_party_sip_account"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</layout>

View file

@ -0,0 +1,256 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<variable
name="loginClickListener"
type="View.OnClickListener" />
</data>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_800"
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
android:text="Register"
android:textSize="20sp"
android:textColor="@color/gray_9"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/username_label"
style="@style/default_text_style_700"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="48dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="Username*"
android:textSize="13sp"
android:textColor="@color/gray_9"
app:layout_constraintTop_toBottomOf="@id/title"
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatEditText
style="@style/default_text_style"
android:id="@+id/username"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="John Doe"
android:textSize="14sp"
android:textColor="@color/gray_9"
android:background="@drawable/shape_edit_text_background"
app:layout_constraintTop_toBottomOf="@id/username_label"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/phone_number_label"
style="@style/default_text_style_700"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:text="Phone Number*"
android:textSize="13sp"
android:textColor="@color/gray_9"
app:layout_constraintTop_toBottomOf="@id/username"
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatEditText
style="@style/default_text_style"
android:id="@+id/phone_number"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="+33 6 01 02 03 04 05"
android:textSize="14sp"
android:textColor="@color/gray_9"
android:background="@drawable/shape_edit_text_background"
app:layout_constraintTop_toBottomOf="@id/phone_number_label"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/password_label"
style="@style/default_text_style_700"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:text="Password*"
android:textSize="13sp"
android:textColor="@color/gray_9"
app:layout_constraintTop_toBottomOf="@id/phone_number"
app:layout_constraintStart_toStartOf="parent"/>
<androidx.appcompat.widget.AppCompatEditText
style="@style/default_text_style"
android:id="@+id/password"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="John Doe"
android:textSize="14sp"
android:textColor="@color/gray_9"
android:background="@drawable/shape_edit_text_background"
android:inputType="textPassword"
android:drawableEnd="@drawable/show_password"
android:drawableTint="@color/gray_1"
app:layout_constraintTop_toBottomOf="@id/password_label"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<ImageView
android:id="@+id/create_background"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:src="@drawable/shape_orange_filled_button_background"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/create"
app:layout_constraintBottom_toBottomOf="@id/create" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_600"
android:id="@+id/create"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:paddingTop="13dp"
android:paddingBottom="13dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="Create"
android:textSize="18sp"
android:textColor="@color/white"
android:gravity="center_vertical"
app:layout_constraintTop_toBottomOf="@id/password"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/create_email_account_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="34dp"
android:gravity="center"
android:text="Create an account with your email on:"
android:textSize="14sp"
android:textColor="@color/gray_8"
app:layout_constraintTop_toBottomOf="@id/create"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<ImageView
android:id="@+id/create_email_account_background"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/shape_orange_outlined_button_background"
app:layout_constraintStart_toStartOf="@id/create_email_account"
app:layout_constraintEnd_toEndOf="@id/create_email_account"
app:layout_constraintTop_toTopOf="@id/create_email_account"
app:layout_constraintBottom_toBottomOf="@id/create_email_account" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_600"
android:id="@+id/create_email_account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:paddingTop="6dp"
android:paddingBottom="6dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:text="subscribe.linphone.org"
android:textSize="13sp"
android:textColor="@color/primary_color"
android:gravity="center_vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/create_email_account_label" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/already_an_account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="13dp"
android:paddingBottom="13dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="Already an account?"
android:textSize="14sp"
android:textColor="@color/gray_8"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/login"
app:layout_constraintTop_toTopOf="@id/login"
app:layout_constraintBottom_toBottomOf="@id/login"/>
<ImageView
android:id="@+id/login_background"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/shape_orange_outlined_button_background"
app:layout_constraintStart_toStartOf="@id/login"
app:layout_constraintEnd_toEndOf="@id/login"
app:layout_constraintTop_toTopOf="@id/login"
app:layout_constraintBottom_toBottomOf="@id/login" />
<androidx.appcompat.widget.AppCompatTextView
android:onClick="@{loginClickListener}"
style="@style/default_text_style_600"
android:id="@+id/login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="34dp"
android:layout_marginStart="20dp"
android:layout_marginBottom="20dp"
android:paddingTop="13dp"
android:paddingBottom="13dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="Login"
android:textSize="18sp"
android:textColor="@color/primary_color"
android:gravity="center_vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/already_an_account"
app:layout_constraintTop_toBottomOf="@id/create_email_account"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</layout>

View file

@ -5,6 +5,9 @@
<data>
<import type="android.view.View" />
<variable
name="viewModel"
type="org.linphone.ui.main.viewmodel.DrawerMenuViewModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
@ -66,6 +69,7 @@
</ScrollView>
<ImageView
android:onClick="@{() -> viewModel.addAccount()}"
android:id="@+id/add_account_background"
android:layout_width="0dp"
android:layout_height="0dp"
@ -78,6 +82,7 @@
app:layout_constraintBottom_toBottomOf="@id/add_account" />
<androidx.appcompat.widget.AppCompatTextView
android:onClick="@{() -> viewModel.addAccount()}"
style="@style/default_text_style_600"
android:id="@+id/add_account"
android:layout_width="wrap_content"
@ -85,6 +90,8 @@
android:layout_marginBottom="30dp"
android:paddingTop="13dp"
android:paddingBottom="13dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="Add an account"
android:textSize="18sp"
android:textColor="@color/primary_color"

View file

@ -1,10 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="drawerMenuViewModel"
type="org.linphone.ui.main.viewmodel.DrawerMenuViewModel" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
@ -40,6 +42,7 @@
android:layout_gravity="start">
<include
tools:viewModel="@{drawerMenuViewModel}"
layout="@layout/drawer_menu" />
</RelativeLayout>

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation 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"
android:id="@+id/assistant_nav_graph"
app:startDestination="@id/loginFragment">
<fragment
android:id="@+id/loginFragment"
android:name="org.linphone.ui.assistant.fragment.LoginFragment"
android:label="LoginFragment"
tools:layout="@layout/assistant_login_fragment" >
<action
android:id="@+id/action_loginFragment_to_registerFragment"
app:destination="@id/registerFragment"
app:enterAnim="@anim/slide_in_right"
app:exitAnim="@anim/slide_out_left"
app:popEnterAnim="@anim/slide_in_left"
app:popExitAnim="@anim/slide_out_right" />
</fragment>
<fragment
android:id="@+id/registerFragment"
android:name="org.linphone.ui.assistant.fragment.RegisterFragment"
android:label="RegisterFragment"
tools:layout="@layout/assistant_register_fragment" />
</navigation>