Replaced top bar check icon by big bottom button, fixed conversation users_three icon instead of meeting

This commit is contained in:
Sylvain Berfini 2023-11-21 16:27:34 +01:00
parent ad35f85c3a
commit 373a5f004b
12 changed files with 109 additions and 75 deletions

View file

@ -29,9 +29,8 @@ class Compatibility {
companion object {
private const val TAG = "[Compatibility]"
const val FOREGROUND_SERVICE_TYPE_PHONE_CALL = 4 // Matches ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL
const val FOREGROUND_SERVICE_TYPE_CAMERA = 64// Matches ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA
const val FOREGROUND_SERVICE_TYPE_CAMERA = 64 // Matches ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA
const val FOREGROUND_SERVICE_TYPE_MICROPHONE = 128 // ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE
fun startServiceForeground(

View file

@ -12,8 +12,12 @@ abstract class AbstractAvatarModel {
val images = MutableLiveData<ArrayList<String>>()
val forceConversationIcon = MutableLiveData<Boolean>()
val forceConferenceIcon = MutableLiveData<Boolean>()
val defaultToConversationIcon = MutableLiveData<Boolean>()
val defaultToConferenceIcon = MutableLiveData<Boolean>()
val skipInitials = MutableLiveData<Boolean>()

View file

@ -28,7 +28,6 @@ import android.app.Service.STOP_FOREGROUND_REMOVE
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.content.pm.ServiceInfo
import android.graphics.Bitmap
import android.net.Uri
import android.os.Bundle

View file

@ -170,7 +170,7 @@ class ConversationModel @WorkerThread constructor(val chatRoom: ChatRoom) {
if (isGroup) {
val fakeFriend = coreContext.core.createFriend()
val model = ContactAvatarModel(fakeFriend)
model.defaultToConferenceIcon.postValue(true)
model.defaultToConversationIcon.postValue(true)
model.setPicturesFromFriends(friends)
avatarModel.postValue(model)
} else {

View file

@ -466,7 +466,7 @@ class ConversationInfoViewModel @UiThread constructor() : ViewModel() {
val avatar = if (groupChatRoom) {
val fakeFriend = coreContext.core.createFriend()
val model = ContactAvatarModel(fakeFriend)
model.defaultToConferenceIcon.postValue(true)
model.defaultToConversationIcon.postValue(true)
model.setPicturesFromFriends(friends)
model
} else {

View file

@ -360,6 +360,9 @@ private fun loadContactPictureWithCoil(
if (model.forceConferenceIcon.value == true) {
imageView.load(R.drawable.inset_meeting)
return
} else if (model.forceConversationIcon.value == true) {
imageView.load(R.drawable.inset_users_three)
return
}
if (!skipTrust) {
@ -427,6 +430,8 @@ private fun getErrorImageLoader(
return if (initials.isEmpty() || initials == "+" || model.skipInitials.value == true) {
if (model.defaultToConferenceIcon.value == true) {
R.drawable.inset_meeting
} else if (model.defaultToConversationIcon.value == true) {
R.drawable.inset_users_three
} else {
R.drawable.inset_user_circle
}

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/users_three"
android:inset="8dp">
</inset>

View file

@ -22,7 +22,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
android:background="@color/gray_100">
<ImageView
android:id="@+id/back"
@ -32,6 +32,7 @@
android:adjustViewBounds="true"
android:padding="15dp"
android:src="@drawable/caret_left"
android:background="@color/white"
app:tint="@color/orange_main_500"
app:layout_constraintBottom_toBottomOf="@id/title"
app:layout_constraintStart_toStartOf="parent"
@ -42,36 +43,23 @@
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="@dimen/top_bar_height"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:paddingStart="10dp"
android:background="@color/white"
android:text="@{viewModel.isEdit ? @string/contact_edit_title : @string/contact_new_title, default=@string/contact_new_title}"
app:layout_constraintEnd_toStartOf="@id/save"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/back"
app:layout_constraintTop_toTopOf="parent"/>
<ImageView
android:onClick="@{() -> viewModel.saveChanges()}"
android:id="@+id/save"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:padding="15dp"
android:adjustViewBounds="true"
android:src="@drawable/check"
app:tint="@color/primary_color_selector"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="@id/title"
app:layout_constraintTop_toTopOf="@id/title" />
<ScrollView
android:id="@+id/scrollView"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/gray_100"
android:layout_marginBottom="16dp"
android:fillViewport="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/title"
app:layout_constraintBottom_toBottomOf="parent">
app:layout_constraintBottom_toTopOf="@id/save">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
@ -343,6 +331,23 @@
</ScrollView>
<androidx.appcompat.widget.AppCompatTextView
style="@style/primary_button_label_style"
android:id="@+id/save"
android:onClick="@{() -> viewModel.saveChanges()}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="@string/contact_editor_save_title"
app:layout_constraintWidth_max="@dimen/button_max_width"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View file

@ -42,24 +42,10 @@
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:text="@string/conversation_add_participants_title"
app:layout_constraintEnd_toStartOf="@id/add_participants"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/back"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/add_participants"
android:onClick="@{() -> viewModel.addParticipants()}"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:padding="15dp"
android:adjustViewBounds="true"
android:src="@drawable/check"
android:enabled="@{viewModel.selection.size() > 0}"
app:tint="@color/primary_color_selector"
app:layout_constraintBottom_toBottomOf="@id/title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/title" />
<View
android:id="@+id/background"
android:layout_width="0dp"
@ -151,7 +137,7 @@
app:layout_constraintVertical_bias="0.3"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/search_bar"
app:layout_constraintBottom_toBottomOf="parent" />
app:layout_constraintBottom_toTopOf="@id/add_participants" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/section_header_style"
@ -170,11 +156,30 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:visibility="@{viewModel.contactsAndSuggestionsList.size() == 0 ? View.GONE : View.VISIBLE}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/search_bar"
app:layout_constraintBottom_toBottomOf="parent" />
app:layout_constraintBottom_toTopOf="@id/add_participants" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/primary_button_label_style"
android:id="@+id/add_participants"
android:onClick="@{() -> viewModel.addParticipants()}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="@string/dialog_continue"
android:enabled="@{viewModel.selection.size() > 0}"
app:layout_constraintWidth_max="@dimen/button_max_width"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -58,32 +58,20 @@
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:text="@string/meeting_schedule_title"
app:layout_constraintEnd_toStartOf="@id/schedule"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/back"
app:layout_constraintTop_toTopOf="parent"/>
<ImageView
android:id="@+id/schedule"
android:onClick="@{() -> viewModel.schedule()}"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:padding="15dp"
android:adjustViewBounds="true"
android:src="@drawable/check"
app:tint="@color/orange_main_500"
app:layout_constraintBottom_toBottomOf="@id/title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/title" />
<ScrollView
android:id="@+id/scrollView"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="16dp"
android:fillViewport="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/title"
app:layout_constraintBottom_toBottomOf="parent">
app:layout_constraintBottom_toTopOf="@id/schedule">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
@ -543,6 +531,23 @@
</ScrollView>
<androidx.appcompat.widget.AppCompatTextView
style="@style/primary_button_label_style"
android:id="@+id/schedule"
android:onClick="@{() -> viewModel.schedule()}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="@string/meeting_schedule_create_title"
app:layout_constraintWidth_max="@dimen/button_max_width"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<include

View file

@ -48,26 +48,11 @@
android:layout_width="0dp"
android:layout_height="@dimen/top_bar_height"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:text="@string/new_conversation_title"
app:layout_constraintEnd_toStartOf="@id/create_group"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/back"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/create_group"
android:onClick="@{() -> viewModel.createGroupChatRoom()}"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:padding="15dp"
android:adjustViewBounds="true"
android:src="@drawable/check"
android:enabled="@{viewModel.groupChatRoomCreateButtonEnabled}"
app:tint="@color/primary_color_selector"
app:layout_constraintBottom_toBottomOf="@id/title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/title" />
<View
android:id="@+id/background"
android:layout_width="0dp"
@ -219,7 +204,7 @@
android:layout_marginTop="28dp"
android:background="@drawable/shape_orange_round"
android:padding="10dp"
android:src="@drawable/meeting"
android:src="@drawable/users_three"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/search_bar"
app:tint="@color/white" />
@ -255,7 +240,7 @@
app:layout_constraintVertical_bias="0.3"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/group_chat_icon"
app:layout_constraintBottom_toBottomOf="parent" />
app:layout_constraintBottom_toTopOf="@id/create_group" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/section_header_style"
@ -278,7 +263,27 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/group_chat_icon"
app:layout_constraintBottom_toBottomOf="parent" />
app:layout_constraintBottom_toTopOf="@id/create_group" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/primary_button_label_style"
android:id="@+id/create_group"
android:onClick="@{() -> viewModel.createGroupChatRoom()}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="@string/dialog_continue"
android:enabled="@{viewModel.groupChatRoomCreateButtonEnabled}"
app:layout_constraintWidth_max="@dimen/button_max_width"
app:layout_constraintTop_toBottomOf="@id/contacts_list"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -326,6 +326,7 @@
<string name="contact_editor_error_saving_changes_toast">Failed to save changes!</string>
<string name="contact_editor_saved_contact_toast">Contact was successfully created</string>
<string name="contact_editor_error_saving_contact_toast">Failed to create contact!</string>
<string name="contact_editor_save_title">Save</string>
<string name="contact_details_numbers_and_addresses_title">Phone numbers &amp; SIP addresses</string>
<string name="contact_details_company_name">Company:</string>
@ -434,6 +435,7 @@
<string name="meeting_info_export_as_calendar_event">Create calendar event</string>
<string name="meeting_info_deleted_toast">Meeting has been deleted</string>
<string name="meeting_schedule_description_title">Description</string>
<string name="meeting_schedule_create_title">Create</string>
<string name="meeting_waiting_room_join">Join</string>