Added warning fragment before configuring a generic SIP account
This commit is contained in:
parent
cf52d5ab3d
commit
92e13a2e6b
7 changed files with 135 additions and 6 deletions
|
@ -802,10 +802,10 @@ internal fun WelcomeFragment.navigateToAccountLogin() {
|
|||
}
|
||||
}
|
||||
|
||||
internal fun WelcomeFragment.navigateToGenericLogin() {
|
||||
internal fun WelcomeFragment.navigateToGenericLoginWarning() {
|
||||
if (findNavController().currentDestination?.id == R.id.welcomeFragment) {
|
||||
findNavController().navigate(
|
||||
R.id.action_welcomeFragment_to_genericAccountLoginFragment,
|
||||
R.id.action_welcomeFragment_to_genericAccountWarningFragment,
|
||||
null,
|
||||
popupTo()
|
||||
)
|
||||
|
@ -842,6 +842,16 @@ internal fun AccountLoginFragment.navigateToPhoneAccountValidation(args: Bundle?
|
|||
}
|
||||
}
|
||||
|
||||
internal fun GenericAccountWarningFragment.navigateToGenericLogin() {
|
||||
if (findNavController().currentDestination?.id == R.id.genericAccountWarningFragment) {
|
||||
findNavController().navigate(
|
||||
R.id.action_genericAccountWarningFragment_to_genericAccountLoginFragment,
|
||||
null,
|
||||
popupTo(R.id.welcomeFragment, popUpInclusive = false)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
internal fun GenericAccountLoginFragment.navigateToEchoCancellerCalibration() {
|
||||
if (findNavController().currentDestination?.id == R.id.genericAccountLoginFragment) {
|
||||
findNavController().navigate(
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Copyright (c) 2010-2022 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.activities.assistant.fragments
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import org.linphone.R
|
||||
import org.linphone.activities.GenericFragment
|
||||
import org.linphone.activities.navigateToGenericLogin
|
||||
import org.linphone.databinding.AssistantGenericAccountWarningFragmentBinding
|
||||
|
||||
class GenericAccountWarningFragment : GenericFragment<AssistantGenericAccountWarningFragmentBinding>() {
|
||||
override fun getLayoutId(): Int = R.layout.assistant_generic_account_warning_fragment
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
binding.lifecycleOwner = viewLifecycleOwner
|
||||
|
||||
binding.setUnderstoodClickListener {
|
||||
navigateToGenericLogin()
|
||||
}
|
||||
}
|
||||
}
|
|
@ -35,7 +35,6 @@ import org.linphone.activities.*
|
|||
import org.linphone.activities.assistant.viewmodels.WelcomeViewModel
|
||||
import org.linphone.activities.navigateToAccountLogin
|
||||
import org.linphone.activities.navigateToEmailAccountCreation
|
||||
import org.linphone.activities.navigateToGenericLogin
|
||||
import org.linphone.activities.navigateToRemoteProvisioning
|
||||
import org.linphone.databinding.AssistantWelcomeFragmentBinding
|
||||
|
||||
|
@ -65,7 +64,7 @@ class WelcomeFragment : GenericFragment<AssistantWelcomeFragmentBinding>() {
|
|||
}
|
||||
|
||||
binding.setGenericAccountLoginClickListener {
|
||||
navigateToGenericLogin()
|
||||
navigateToGenericLoginWarning()
|
||||
}
|
||||
|
||||
binding.setRemoteProvisioningClickListener {
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
<variable
|
||||
name="understoodClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/top_bar_fragment"
|
||||
android:name="org.linphone.activities.assistant.fragments.TopBarFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/main_activity_top_bar_size"
|
||||
android:layout_alignParentTop="true"
|
||||
tools:layout="@layout/assistant_top_bar_fragment" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/top_bar_fragment"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/warning_text"
|
||||
style="@style/standard_small_text_font"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="@string/assistant_generic_account_warning"/>
|
||||
|
||||
<TextView
|
||||
android:textColor="?attr/accentColor"
|
||||
android:textSize="16sp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:autoLink="web"
|
||||
android:gravity="center"
|
||||
android:paddingTop="20dp"
|
||||
android:textColorLink="@color/primary_color"
|
||||
android:text="@string/assistant_generic_account_warning_contact_link" />
|
||||
|
||||
<Button
|
||||
android:onClick="@{understoodClickListener}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="40dp"
|
||||
android:text="@string/assistant_generic_account_warning_continue_button_text" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
|
@ -20,8 +20,8 @@
|
|||
android:id="@+id/action_welcomeFragment_to_phoneAccountCreationFragment"
|
||||
app:destination="@id/phoneAccountCreationFragment" />
|
||||
<action
|
||||
android:id="@+id/action_welcomeFragment_to_genericAccountLoginFragment"
|
||||
app:destination="@id/genericAccountLoginFragment" />
|
||||
android:id="@+id/action_welcomeFragment_to_genericAccountWarningFragment"
|
||||
app:destination="@id/genericAccountWarningFragment" />
|
||||
<action
|
||||
android:id="@+id/action_welcomeFragment_to_remoteProvisioningFragment"
|
||||
app:destination="@id/remoteProvisioningFragment" />
|
||||
|
@ -38,6 +38,15 @@
|
|||
android:id="@+id/action_accountLoginFragment_to_phoneAccountValidationFragment"
|
||||
app:destination="@id/phoneAccountValidationFragment" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/genericAccountWarningFragment"
|
||||
android:name="org.linphone.activities.assistant.fragments.GenericAccountWarningFragment"
|
||||
tools:layout="@layout/assistant_generic_account_warning_fragment"
|
||||
android:label="GenericAccountWarningFragment" >
|
||||
<action
|
||||
android:id="@+id/action_genericAccountWarningFragment_to_genericAccountLoginFragment"
|
||||
app:destination="@id/genericAccountLoginFragment" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/genericAccountLoginFragment"
|
||||
android:name="org.linphone.activities.assistant.fragments.GenericAccountLoginFragment"
|
||||
|
|
|
@ -633,4 +633,6 @@
|
|||
<string name="chat_message_removal_info">Le message va être supprimé</string>
|
||||
<string name="chat_message_abort_removal">Annuler</string>
|
||||
<string name="about_weblate_translation">Contribuer aux traductions</string>
|
||||
<string name="assistant_generic_account_warning">Certaines fonctionnalités avancées comme les messages de groupe ou les messages éphémères nécessitent un compte &appName;.\n\nElles seront masquées dans l\'application si vous configurez un compte SIP tiers.\n\nSi vous souhaitez les activer pour un projet professionnel, contactez-nous.</string>
|
||||
<string name="assistant_generic_account_warning_continue_button_text">J\'ai compris</string>
|
||||
</resources>
|
|
@ -293,6 +293,9 @@
|
|||
<string name="assistant_general_terms">terms of use</string>
|
||||
<string name="assistant_privacy_policy">privacy policy</string>
|
||||
<string name="assistant_read_and_agree_terms">I accept Belledonne Communications\' %1$s and %2$s</string>
|
||||
<string name="assistant_generic_account_warning">Some features require a &appName; account, such as group messaging or ephemeral messaging.\n\nThese features are hidden when you register with a third party SIP account.\n\nTo enable it in a commercial project, please contact us.</string>
|
||||
<string name="assistant_generic_account_warning_contact_link" translatable="false">https://www.linphone.org/contact</string>
|
||||
<string name="assistant_generic_account_warning_continue_button_text">I understand</string>
|
||||
|
||||
<!-- Assistant errors -->
|
||||
<string name="assistant_error_phone_number_invalid_characters">Only digits are expected here</string>
|
||||
|
|
Loading…
Reference in a new issue