diff --git a/.idea/navEditor.xml b/.idea/navEditor.xml index f5c9295add..913c998429 100644 --- a/.idea/navEditor.xml +++ b/.idea/navEditor.xml @@ -847,6 +847,95 @@ + + + + + + + diff --git a/app/src/main/java/com/infomaniak/mail/ui/newMessage/AiEngineChoiceFragment.kt b/app/src/main/java/com/infomaniak/mail/ui/newMessage/AiEngineChoiceFragment.kt index 0e6f0334f4..b677dd0460 100644 --- a/app/src/main/java/com/infomaniak/mail/ui/newMessage/AiEngineChoiceFragment.kt +++ b/app/src/main/java/com/infomaniak/mail/ui/newMessage/AiEngineChoiceFragment.kt @@ -50,7 +50,7 @@ class AiEngineChoiceFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) setSystemBarsColors(statusBarColor = R.color.backgroundColor) - + binding.toolbar.setNavigationOnClickListener { findNavController().popBackStack() } sharedUtils.manageAiEngineSettings(this, choiceBinding.radioGroup, "promptAiEngine") { diff --git a/app/src/main/java/com/infomaniak/mail/views/InformationBlockView.kt b/app/src/main/java/com/infomaniak/mail/views/InformationBlockView.kt index e0ebaaa0c2..5cba48536e 100644 --- a/app/src/main/java/com/infomaniak/mail/views/InformationBlockView.kt +++ b/app/src/main/java/com/infomaniak/mail/views/InformationBlockView.kt @@ -22,6 +22,7 @@ import android.graphics.drawable.Drawable import android.util.AttributeSet import android.view.LayoutInflater import android.widget.FrameLayout +import androidx.core.view.isGone import androidx.core.view.isVisible import com.infomaniak.lib.core.utils.getAttributes import com.infomaniak.mail.R @@ -41,22 +42,28 @@ class InformationBlockView @JvmOverloads constructor( var title: CharSequence? get() = binding.informationTitle.text set(value) { - binding.informationTitle.text = value - binding.informationTitle.isVisible = true + binding.informationTitle.apply { + text = value + isGone = value.isNullOrBlank() + } } var description: CharSequence? get() = binding.informationDescription.text set(value) { - binding.informationDescription.text = value - binding.informationDescription.isVisible = true + binding.informationDescription.apply { + text = value + isGone = value.isNullOrBlank() + } } var buttonLabel: CharSequence? get() = binding.informationButton.text set(value) { - binding.informationButton.text = value - binding.informationButton.isVisible = true + binding.informationButton.apply { + text = value + isGone = value.isNullOrBlank() + } } var icon: Drawable? @@ -67,20 +74,10 @@ class InformationBlockView @JvmOverloads constructor( init { attrs?.getAttributes(context, R.styleable.InformationBlockView) { - binding.informationTitle.apply { - val text = getString(R.styleable.InformationBlockView_title) - if (!text.isNullOrBlank()) title = text - } - binding.informationDescription.apply { - val text = getString(R.styleable.InformationBlockView_description) - if (!text.isNullOrBlank()) description = text - } - binding.informationButton.apply { - val text = getString(R.styleable.InformationBlockView_button) - if (!text.isNullOrBlank()) buttonLabel = text - - setOnClickListener { onActionClicked?.invoke() } - } + title = getString(R.styleable.InformationBlockView_title) + description = getString(R.styleable.InformationBlockView_description) + buttonLabel = getString(R.styleable.InformationBlockView_buttonLabel) + binding.informationButton.setOnClickListener { onActionClicked?.invoke() } icon = getDrawable(R.styleable.InformationBlockView_icon) binding.closeButton.apply { isVisible = getBoolean(R.styleable.InformationBlockView_showCloseIcon, false) diff --git a/app/src/main/res/layout/fragment_no_valid_mailboxes.xml b/app/src/main/res/layout/fragment_no_valid_mailboxes.xml index cd6db9e056..ea0d224db6 100644 --- a/app/src/main/res/layout/fragment_no_valid_mailboxes.xml +++ b/app/src/main/res/layout/fragment_no_valid_mailboxes.xml @@ -49,7 +49,7 @@ android:layout_height="wrap_content" android:layout_marginHorizontal="@dimen/marginStandard" android:layout_marginTop="@dimen/marginLarge" - app:button="@string/readFAQ" + app:buttonLabel="@string/readFAQ" app:description="@string/lockedMailboxScreenDescription" app:icon="@drawable/ic_warning" app:layout_constraintTop_toBottomOf="@id/logo" @@ -96,7 +96,7 @@ style="@style/BodyMedium" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="@dimen/marginStandard" + android:layout_marginHorizontal="@dimen/marginStandardMedium" android:layout_marginTop="@dimen/marginStandard" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" diff --git a/app/src/main/res/layout/view_information_block.xml b/app/src/main/res/layout/view_information_block.xml index ae05214b9f..aaae617e6f 100644 --- a/app/src/main/res/layout/view_information_block.xml +++ b/app/src/main/res/layout/view_information_block.xml @@ -30,55 +30,49 @@ android:layout_margin="@dimen/marginStandardMedium" android:orientation="horizontal"> + + + android:layout_height="wrap_content" + android:divider="@drawable/spacer_standard_medium" + android:orientation="vertical" + android:showDividers="middle"> + android:visibility="gone" + tools:text="@string/aiErrorTooManyRequests" + tools:visibility="visible" /> - + android:visibility="gone" + tools:text="@string/aiErrorTooManyRequests" + tools:visibility="visible" /> - - - - - + - - +