mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Added help popup for international prefix picker in account profile
This commit is contained in:
parent
9c06c9802d
commit
ea87c48586
4 changed files with 114 additions and 1 deletions
|
|
@ -103,7 +103,7 @@ class AccountProfileFragment : GenericFragment() {
|
|||
}
|
||||
|
||||
binding.setPrefixTooltipClickListener {
|
||||
// TODO
|
||||
showHelpPopup()
|
||||
}
|
||||
|
||||
binding.setChangeModeClickListener {
|
||||
|
|
@ -195,4 +195,10 @@ class AccountProfileFragment : GenericFragment() {
|
|||
binding.prefix.onItemSelectedListener = dropdownListener
|
||||
binding.prefix.setSelection(dialPlanIndex)
|
||||
}
|
||||
|
||||
@UiThread
|
||||
private fun showHelpPopup() {
|
||||
val dialog = DialogUtils.getAccountInternationalPrefixHelpDialog(requireActivity())
|
||||
dialog.show()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ import org.linphone.databinding.DialogConfirmZrtpSasBinding
|
|||
import org.linphone.databinding.DialogContactConfirmTrustCallBinding
|
||||
import org.linphone.databinding.DialogContactTrustProcessBinding
|
||||
import org.linphone.databinding.DialogDeleteContactBinding
|
||||
import org.linphone.databinding.DialogManageAccountInternationalPrefixHelpBinding
|
||||
import org.linphone.databinding.DialogPickNumberOrAddressBinding
|
||||
import org.linphone.databinding.DialogRemoveAccountBinding
|
||||
import org.linphone.databinding.DialogRemoveAllCallLogsBinding
|
||||
|
|
@ -86,6 +87,23 @@ class DialogUtils {
|
|||
return getDialog(context, binding)
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun getAccountInternationalPrefixHelpDialog(context: Context): Dialog {
|
||||
val binding: DialogManageAccountInternationalPrefixHelpBinding = DataBindingUtil.inflate(
|
||||
LayoutInflater.from(context),
|
||||
R.layout.dialog_manage_account_international_prefix_help,
|
||||
null,
|
||||
false
|
||||
)
|
||||
val dialog = getDialog(context, binding)
|
||||
|
||||
binding.setDismissClickListener {
|
||||
dialog.dismiss()
|
||||
}
|
||||
|
||||
return dialog
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun getAccountModeExplanationDialog(
|
||||
context: Context,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,87 @@
|
|||
<?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">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View" />
|
||||
<variable
|
||||
name="dismissClickListener"
|
||||
type="View.OnClickListener" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:onClick="@{dismissClickListener}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dialog_background"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:src="@drawable/shape_dialog_background"
|
||||
app:layout_constraintWidth_max="@dimen/dialog_max_width"
|
||||
app:layout_constraintBottom_toBottomOf="@id/anchor"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/title" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/section_header_style"
|
||||
android:id="@+id/title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:paddingTop="@dimen/dialog_top_bottom_margin"
|
||||
android:text="@string/dialog_account_international_prefix_help_title"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintBottom_toTopOf="@id/message"
|
||||
app:layout_constraintStart_toStartOf="@id/dialog_background"
|
||||
app:layout_constraintEnd_toEndOf="@id/dialog_background"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:id="@+id/message"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/dialog_account_international_prefix_help_message"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toTopOf="@id/confirm"
|
||||
app:layout_constraintStart_toStartOf="@id/dialog_background"
|
||||
app:layout_constraintEnd_toEndOf="@id/dialog_background"
|
||||
app:layout_constraintTop_toBottomOf="@id/title" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:onClick="@{dismissClickListener}"
|
||||
style="@style/primary_button_label_style"
|
||||
android:id="@+id/confirm"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:text="@string/dialog_ok"
|
||||
app:layout_constraintStart_toStartOf="@id/dialog_background"
|
||||
app:layout_constraintEnd_toEndOf="@id/dialog_background"
|
||||
app:layout_constraintTop_toBottomOf="@id/message"
|
||||
app:layout_constraintBottom_toTopOf="@id/anchor"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/anchor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dialog_top_bottom_margin"
|
||||
app:layout_constraintTop_toBottomOf="@id/confirm"
|
||||
app:layout_constraintStart_toStartOf="@id/dialog_background"
|
||||
app:layout_constraintEnd_toEndOf="@id/dialog_background"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
|
|
@ -96,6 +96,8 @@
|
|||
<string name="dialog_remove_account_message">You can reconnect at any time by clicking “Add an account”. However, all data on this phone will be deleted.</string>
|
||||
<string name="dialog_update_available_title">Update available</string>
|
||||
<string name="dialog_update_available_message">A new version %s is available. Do you want to update?</string>
|
||||
<string name="dialog_account_international_prefix_help_title">Why do we need it?</string>
|
||||
<string name="dialog_account_international_prefix_help_message">Blah blah blah</string>
|
||||
|
||||
<string name="toast_assistant_qr_code_invalid">Invalid QR code!</string>
|
||||
<string name="toast_sip_address_copied_to_clipboard">SIP address copied into clipboard</string>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue