mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Improved empty lists (contacts & conversations) labels + added button to let user know it can change account
This commit is contained in:
parent
b740409642
commit
e38040428b
10 changed files with 128 additions and 30 deletions
|
|
@ -70,6 +70,8 @@ open class AbstractMainViewModel
|
|||
|
||||
val isFilterEmpty = MutableLiveData<Boolean>()
|
||||
|
||||
val moreThanOneAccount = MutableLiveData<Boolean>()
|
||||
|
||||
val focusSearchBarEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
|
@ -146,6 +148,16 @@ open class AbstractMainViewModel
|
|||
}
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
override fun onAccountAdded(core: Core, account: Account) {
|
||||
moreThanOneAccount.postValue(core.accountList.size > 1)
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
override fun onAccountRemoved(core: Core, account: Account) {
|
||||
moreThanOneAccount.postValue(core.accountList.size > 1)
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
override fun onDefaultAccountChanged(core: Core, defaultAccount: Account?) {
|
||||
updateAvailableMenus()
|
||||
|
|
@ -175,6 +187,7 @@ open class AbstractMainViewModel
|
|||
hideMeetings.value = !coreContext.defaultAccountHasVideoConferenceFactoryUri
|
||||
|
||||
coreContext.postOnCoreThread { core ->
|
||||
moreThanOneAccount.postValue(core.accountList.size > 1)
|
||||
core.addListener(coreListener)
|
||||
configure()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,22 +74,45 @@
|
|||
android:src="@drawable/illu"
|
||||
android:contentDescription="@null"
|
||||
app:layout_constraintHeight_max="200dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/no_conversation_label"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"
|
||||
app:layout_constraintTop_toBottomOf="@id/background" />
|
||||
app:layout_constraintTop_toTopOf="@id/background"
|
||||
app:layout_constraintBottom_toTopOf="@id/no_conversation_label" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/section_header_style"
|
||||
android:id="@+id/no_conversation_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.isFilterEmpty ? @string/conversations_list_empty : @string/list_filter_no_result_found, default=@string/conversations_list_empty}"
|
||||
app:layout_constraintBottom_toTopOf="@id/background"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"
|
||||
app:layout_constraintTop_toBottomOf="@id/no_conversation_image" />
|
||||
app:layout_constraintTop_toBottomOf="@id/no_conversation_image"
|
||||
app:layout_constraintBottom_toTopOf="@id/show_accounts_list"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_600"
|
||||
android:id="@+id/show_accounts_list"
|
||||
android:onClick="@{() -> viewModel.openDrawerMenu()}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="6dp"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:text="@string/history_list_change_selected_account_label"
|
||||
android:textSize="13sp"
|
||||
android:textColor="@color/secondary_button_label_color"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/secondary_button_background"
|
||||
android:visibility="@{viewModel.conversations.empty && viewModel.moreThanOneAccount ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintTop_toBottomOf="@id/no_conversation_label"
|
||||
app:layout_constraintBottom_toBottomOf="@id/background"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/conversations_list"
|
||||
|
|
|
|||
|
|
@ -128,10 +128,11 @@
|
|||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/section_header_style"
|
||||
android:id="@+id/no_contacts_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.isFilterEmpty ? (viewModel.areAllContactsDisplayed ? @string/contacts_list_empty : @string/contacts_list_sip_empty) : @string/list_filter_no_result_found, default=@string/contacts_list_sip_empty}"
|
||||
app:layout_constraintBottom_toTopOf="@id/lists"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintBottom_toTopOf="@id/show_contacts_filter"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"
|
||||
app:layout_constraintTop_toBottomOf="@id/no_contacts_image" />
|
||||
|
|
@ -154,6 +155,7 @@
|
|||
android:background="@drawable/secondary_button_background"
|
||||
android:visibility="@{viewModel.contactsList.empty && !viewModel.areAllContactsDisplayed ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintTop_toBottomOf="@id/no_contacts_label"
|
||||
app:layout_constraintBottom_toTopOf="@id/lists"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"/>
|
||||
|
||||
|
|
|
|||
|
|
@ -88,18 +88,41 @@
|
|||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"
|
||||
app:layout_constraintTop_toBottomOf="@id/background" />
|
||||
app:layout_constraintTop_toTopOf="@id/background" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/section_header_style"
|
||||
android:id="@+id/no_calls_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.isFilterEmpty ? @string/history_list_empty_history : @string/list_filter_no_result_found, default=@string/history_list_empty_history}"
|
||||
app:layout_constraintBottom_toTopOf="@id/background"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"
|
||||
app:layout_constraintTop_toBottomOf="@id/no_calls_image" />
|
||||
app:layout_constraintTop_toBottomOf="@id/no_calls_image"
|
||||
app:layout_constraintBottom_toTopOf="@id/show_accounts_list"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_600"
|
||||
android:id="@+id/show_accounts_list"
|
||||
android:onClick="@{() -> viewModel.openDrawerMenu()}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="6dp"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:text="@string/history_list_change_selected_account_label"
|
||||
android:textSize="13sp"
|
||||
android:textColor="@color/secondary_button_label_color"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/secondary_button_background"
|
||||
android:visibility="@{viewModel.callLogs.empty && viewModel.moreThanOneAccount ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintTop_toBottomOf="@id/no_calls_label"
|
||||
app:layout_constraintBottom_toBottomOf="@id/background"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/history_list"
|
||||
|
|
|
|||
|
|
@ -81,14 +81,36 @@
|
|||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/section_header_style"
|
||||
android:id="@+id/no_conversation_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.isFilterEmpty ? @string/conversations_list_empty : @string/list_filter_no_result_found, default=@string/conversations_list_empty}"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/no_conversation_image"
|
||||
app:layout_constraintBottom_toBottomOf="@id/conversations_list"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_600"
|
||||
android:id="@+id/show_accounts_list"
|
||||
android:onClick="@{() -> viewModel.openDrawerMenu()}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="6dp"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:text="@string/history_list_change_selected_account_label"
|
||||
android:textSize="13sp"
|
||||
android:textColor="@color/secondary_button_label_color"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/secondary_button_background"
|
||||
android:visibility="@{viewModel.conversations.empty && viewModel.moreThanOneAccount ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintTop_toBottomOf="@id/no_conversation_label"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/fetch_in_progress"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
|||
|
|
@ -129,9 +129,10 @@
|
|||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/section_header_style"
|
||||
android:id="@+id/no_contacts_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.isFilterEmpty ? (viewModel.areAllContactsDisplayed ? @string/contacts_list_empty : @string/contacts_list_sip_empty) : @string/list_filter_no_result_found, default=@string/contacts_list_sip_empty}"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintBottom_toTopOf="@id/lists"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
|
|||
|
|
@ -83,13 +83,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/illu"
|
||||
android:layout_margin="10dp"
|
||||
android:contentDescription="@null"
|
||||
app:layout_constraintHeight_max="200dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/no_contacts_label"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/background" />
|
||||
android:contentDescription="@null" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/section_header_style"
|
||||
|
|
@ -97,11 +91,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/drawer_menu_no_account_configured_yet"
|
||||
android:gravity="center"
|
||||
app:layout_constraintBottom_toTopOf="@id/background"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/no_contacts_image" />
|
||||
android:gravity="center" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -91,14 +91,36 @@
|
|||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/section_header_style"
|
||||
android:id="@+id/no_calls_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.isFilterEmpty ? @string/history_list_empty_history : @string/list_filter_no_result_found, default=@string/history_list_empty_history}"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/no_calls_image"
|
||||
app:layout_constraintBottom_toBottomOf="@id/history_list" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_600"
|
||||
android:id="@+id/show_accounts_list"
|
||||
android:onClick="@{() -> viewModel.openDrawerMenu()}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="6dp"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:text="@string/history_list_change_selected_account_label"
|
||||
android:textSize="13sp"
|
||||
android:textColor="@color/secondary_button_label_color"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/secondary_button_background"
|
||||
android:visibility="@{viewModel.callLogs.empty && viewModel.moreThanOneAccount ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintTop_toBottomOf="@id/no_calls_label"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/fetch_in_progress"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
|||
|
|
@ -362,7 +362,8 @@
|
|||
<string name="history_call_start_no_suggestion_nor_contact">Aucun contact ni suggestion pour le moment…</string>
|
||||
<string name="history_group_call_start_dialog_set_subject">Nommer l\'appel de groupe</string>
|
||||
<string name="history_group_call_start_dialog_subject_hint">Nom de l\'appel de groupe</string>
|
||||
<string name="history_list_empty_history">Aucun appel dans votre historique…</string>
|
||||
<string name="history_list_empty_history">Aucun appel vers/depuis ce compte n\'a été trouvé…</string>
|
||||
<string name="history_list_change_selected_account_label">Changer de compte</string>
|
||||
<string name="history_group_call_go_to_conversation">Conversation</string>
|
||||
|
||||
<string name="history_dialog_delete_all_call_logs_title">Supprimer l\'historique d\'appels ?</string>
|
||||
|
|
@ -431,7 +432,7 @@
|
|||
<string name="contact_device_without_name">Appareil sans nom</string>
|
||||
|
||||
<!-- Chat -->
|
||||
<string name="conversations_list_empty">Aucune conversation pour le moment…</string>
|
||||
<string name="conversations_list_empty">Aucune conversation liée à ce compte pour le moment…</string>
|
||||
<string name="conversations_list_is_being_removed_label">En cours de suppression…</string>
|
||||
<string name="conversations_last_message_format">%s :</string>
|
||||
<plurals name="conversations_files_waiting_to_be_shared_toast" tools:ignore="MissingQuantity">
|
||||
|
|
|
|||
|
|
@ -403,7 +403,8 @@
|
|||
<string name="history_call_start_no_suggestion_nor_contact">No suggestion and no contact for the moment…</string>
|
||||
<string name="history_group_call_start_dialog_set_subject">Set group call subject</string>
|
||||
<string name="history_group_call_start_dialog_subject_hint">Group call subject</string>
|
||||
<string name="history_list_empty_history">No call for the moment…</string>
|
||||
<string name="history_list_empty_history">No call from/to this account was found…</string>
|
||||
<string name="history_list_change_selected_account_label">Change account</string>
|
||||
<string name="history_group_call_go_to_conversation">Conversation</string>
|
||||
|
||||
<string name="history_dialog_delete_all_call_logs_title">Do you really want to delete all calls history?</string>
|
||||
|
|
@ -472,7 +473,7 @@
|
|||
<string name="contact_device_without_name">Unnamed device</string>
|
||||
|
||||
<!-- Chat -->
|
||||
<string name="conversations_list_empty">No conversation for the moment…</string>
|
||||
<string name="conversations_list_empty">No conversation related to this account for the moment…</string>
|
||||
<string name="conversations_list_is_being_removed_label">Removal in progress…</string>
|
||||
<string name="conversations_last_message_format">%s:</string>
|
||||
<plurals name="conversations_files_waiting_to_be_shared_toast">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue