Improve quick action buttons

This commit is contained in:
Arne 2024-09-08 14:05:46 +02:00
parent 95288499e0
commit 6a77d4a71c
2 changed files with 83 additions and 81 deletions

View file

@ -3989,8 +3989,10 @@ public class ConversationFragment extends XmppFragment
if (hasAttachments || binding.textinput.getText().toString().replaceFirst("^(\\w|[, ])+:\\s*", "").length() > 0) {
binding.conversationViewPager.setCurrentItem(0);
params.width = conversation.getThread() == null ? 0 : identiconWidth;
binding.quickButtons.setVisibility(GONE);
} else {
params.width = identiconWidth;
binding.quickButtons.setVisibility(VISIBLE);
}
if (!canWrite()) params.width = 0;
binding.threadIdenticonLayout.setLayoutParams(params);

View file

@ -104,7 +104,7 @@
android:layout_gravity="center_vertical"
android:background="@android:color/transparent"
android:src="@drawable/ic_cancel_24dp"
android:contentDescription="Cancel" />
android:contentDescription="@string/cancel" />
</LinearLayout>
<RelativeLayout
@ -125,96 +125,96 @@
android:layout_toEndOf="@+id/thread_identicon_layout"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp"
android:orientation="horizontal">
android:animateLayoutChanges="true" >
<LinearLayout
android:id="@+id/text_input_layout"
<TextView
android:id="@+id/text_input_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
android:layout_marginBottom="12dp"
android:maxLines="1"
android:textAppearance="?textAppearanceBodySmall"
android:textColor="?colorOnTertiaryContainer"
android:visibility="visible"
tools:text="@string/private_message_to" />
<TextView
android:id="@+id/text_input_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8sp"
android:maxLines="1"
android:textAppearance="?textAppearanceBodySmall"
android:textColor="?colorOnTertiaryContainer"
android:visibility="visible"
tools:text="@string/private_message_to" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/media_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:requiresFadingEdge="horizontal"
android:visibility="gone"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_media_preview">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/media_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:requiresFadingEdge="horizontal"
android:visibility="gone"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_media_preview">
</androidx.recyclerview.widget.RecyclerView>
</androidx.recyclerview.widget.RecyclerView>
<eu.siacs.conversations.ui.widget.EditMessage
android:id="@+id/textinput_subject"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/subject"
android:textColor="?colorOnTertiaryContainer"
android:textColorHint="@color/hint_on_tertiary_container"
android:textCursorDrawable="@drawable/cursor_on_tertiary_container"
android:layout_above="@+id/textinput"
android:maxLines="1"
android:padding="8dp"
android:imeOptions="flagNoExtractUi"
android:inputType="textShortMessage|textMultiLine|textCapSentences"
android:visibility="gone" />
<eu.siacs.conversations.ui.widget.EditMessage
android:id="@+id/textinput_subject"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/subject"
android:textColor="?colorOnTertiaryContainer"
android:textColorHint="@color/hint_on_tertiary_container"
android:textCursorDrawable="@drawable/cursor_on_tertiary_container"
android:maxLines="1"
android:padding="8dp"
android:imeOptions="flagNoExtractUi"
android:inputType="textShortMessage|textMultiLine|textCapSentences"
android:visibility="gone" />
<eu.siacs.conversations.ui.widget.EditMessage
android:id="@+id/textinput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:ems="10"
android:imeOptions="flagNoExtractUi|actionSend"
android:inputType="textShortMessage|textMultiLine|textCapSentences"
android:maxLines="8"
android:minHeight="32dp"
android:textColor="?colorOnTertiaryContainer"
android:textColorHint="@color/hint_on_tertiary_container"
android:textCursorDrawable="@drawable/cursor_on_tertiary_container"
android:minLines="1">
<eu.siacs.conversations.ui.widget.EditMessage
android:id="@+id/textinput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:ems="10"
android:imeOptions="flagNoExtractUi|actionSend"
android:inputType="textShortMessage|textMultiLine|textCapSentences"
android:maxLines="8"
android:minHeight="32dp"
android:textColor="?colorOnTertiaryContainer"
android:textColorHint="@color/hint_on_tertiary_container"
android:textCursorDrawable="@drawable/cursor_on_tertiary_container"
android:minLines="1">
<requestFocus />
</eu.siacs.conversations.ui.widget.EditMessage>
<RelativeLayout
android:id="@+id/quickButtons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:animateLayoutChanges="true" >
<requestFocus />
</eu.siacs.conversations.ui.widget.EditMessage>
</LinearLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/takePictureButton"
style="?attr/materialIconButtonFilledTonalStyle"
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/recordVoiceButton"
android:contentDescription="@string/attach_take_picture"
app:icon="@drawable/ic_camera_alt_24dp"
app:iconSize="24dp"
android:backgroundTint="@android:color/transparent"
android:visibility="visible" />
<com.google.android.material.button.MaterialButton
android:id="@+id/recordVoiceButton"
style="?attr/materialIconButtonFilledTonalStyle"
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:contentDescription="@string/attach_record_voice"
app:icon="@drawable/ic_mic_24dp"
app:iconSize="24dp"
android:backgroundTint="@android:color/transparent"
android:visibility="visible" />
<com.google.android.material.button.MaterialButton
android:id="@+id/takePictureButton"
style="?attr/materialIconButtonFilledTonalStyle"
android:layout_width="38dp"
android:layout_height="32dp"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/recordVoiceButton"
android:contentDescription="@string/attach_take_picture"
app:icon="@drawable/ic_camera_alt_24dp"
app:iconSize="24dp"
app:iconTint="?colorSurfaceInverse"
android:backgroundTint="@android:color/transparent" />
<com.google.android.material.button.MaterialButton
android:id="@+id/recordVoiceButton"
style="?attr/materialIconButtonFilledTonalStyle"
android:layout_width="38dp"
android:layout_height="32dp"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:contentDescription="@string/attach_record_voice"
app:icon="@drawable/ic_mic_24dp"
app:iconSize="24dp"
app:iconTint="?colorSurfaceInverse"
android:backgroundTint="@android:color/transparent" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/thread_identicon_layout"