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) { if (hasAttachments || binding.textinput.getText().toString().replaceFirst("^(\\w|[, ])+:\\s*", "").length() > 0) {
binding.conversationViewPager.setCurrentItem(0); binding.conversationViewPager.setCurrentItem(0);
params.width = conversation.getThread() == null ? 0 : identiconWidth; params.width = conversation.getThread() == null ? 0 : identiconWidth;
binding.quickButtons.setVisibility(GONE);
} else { } else {
params.width = identiconWidth; params.width = identiconWidth;
binding.quickButtons.setVisibility(VISIBLE);
} }
if (!canWrite()) params.width = 0; if (!canWrite()) params.width = 0;
binding.threadIdenticonLayout.setLayoutParams(params); binding.threadIdenticonLayout.setLayoutParams(params);

View file

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