mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-27 00:57:42 +00:00
Show attachment button while composing text.
Previously, we'd only show the attachment button when the user had yet to enter any text. To add an attachment after text was entered, you'd have to go to the three-dot menu. Now we just show a little attach button in the text area. I also took the opportunity to clean up other button paddings and stuff in the compose area so things look better and react to text sizes more predictably.
This commit is contained in:
@@ -54,30 +54,32 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingStart="10dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiToggle
|
||||
android:id="@+id/emoji_toggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="14dp"
|
||||
android:layout_marginStart="14dp"
|
||||
android:background="@drawable/touch_highlight_background"
|
||||
android:layout_height="@dimen/conversation_compose_height"
|
||||
android:layout_gravity="bottom"
|
||||
android:paddingLeft="4dp"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/conversation_activity__emoji_toggle_description" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/conversation_compose_height" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.ComposeText
|
||||
style="@style/ComposeEditText"
|
||||
android:id="@+id/embedded_text_editor"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="6dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginRight="6dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:nextFocusForward="@+id/send_button"
|
||||
@@ -87,57 +89,84 @@
|
||||
<requestFocus />
|
||||
</org.thoughtcrime.securesms.components.ComposeText>
|
||||
|
||||
<org.thoughtcrime.securesms.components.HidingLinearLayout
|
||||
android:id="@+id/quick_attachment_toggle"
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/quick_camera_toggle"
|
||||
<org.thoughtcrime.securesms.components.HidingLinearLayout
|
||||
android:id="@+id/quick_attachment_toggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="?quick_camera_icon"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
android:background="@drawable/touch_highlight_background"
|
||||
android:contentDescription="@string/conversation_activity__quick_attachment_drawer_toggle_camera_description" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.MicrophoneRecorderView
|
||||
android:id="@+id/recorder_view"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_gravity="right|end"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/quick_audio_toggle"
|
||||
android:id="@+id/quick_camera_toggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:padding="6dp"
|
||||
android:src="?quick_mic_icon"
|
||||
android:background="@null"
|
||||
android:contentDescription="@string/conversation_activity__quick_attachment_drawer_record_and_send_audio_description" />
|
||||
android:src="?quick_camera_icon"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/conversation_activity__quick_attachment_drawer_toggle_camera_description" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/quick_audio_fab"
|
||||
android:layout_width="74dp"
|
||||
android:layout_height="74dp"
|
||||
android:src="@drawable/ic_mic_white_48dp"
|
||||
android:background="@drawable/circle_tintable"
|
||||
android:backgroundTint="@color/core_red"
|
||||
android:visibility="gone"
|
||||
android:scaleType="center"/>
|
||||
<org.thoughtcrime.securesms.components.MicrophoneRecorderView
|
||||
android:id="@+id/recorder_view"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
</org.thoughtcrime.securesms.components.MicrophoneRecorderView>
|
||||
<ImageButton
|
||||
android:id="@+id/quick_audio_toggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:padding="6dp"
|
||||
android:src="?quick_mic_icon"
|
||||
android:background="@null"
|
||||
android:contentDescription="@string/conversation_activity__quick_attachment_drawer_record_and_send_audio_description" />
|
||||
|
||||
</org.thoughtcrime.securesms.components.HidingLinearLayout>
|
||||
<ImageView
|
||||
android:id="@+id/quick_audio_fab"
|
||||
android:layout_width="74dp"
|
||||
android:layout_height="74dp"
|
||||
android:src="@drawable/ic_mic_white_48dp"
|
||||
android:background="@drawable/circle_tintable"
|
||||
android:backgroundTint="@color/core_red"
|
||||
android:visibility="gone"
|
||||
android:scaleType="center"/>
|
||||
|
||||
</org.thoughtcrime.securesms.components.MicrophoneRecorderView>
|
||||
|
||||
</org.thoughtcrime.securesms.components.HidingLinearLayout>
|
||||
|
||||
<org.thoughtcrime.securesms.components.HidingLinearLayout
|
||||
android:id="@+id/inline_attachment_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right|end">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/inline_attachment_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/conversation_compose_height"
|
||||
android:layout_gravity="bottom"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_add_white_24dp"
|
||||
android:tint="?attr/conversation_input_inline_attach_icon_tint"
|
||||
android:background="?selectableItemBackgroundBorderless"/>
|
||||
|
||||
</org.thoughtcrime.securesms.components.HidingLinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -198,8 +227,8 @@
|
||||
|
||||
<org.thoughtcrime.securesms.components.AnimatingToggle
|
||||
android:id="@+id/button_toggle"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_width="@dimen/conversation_compose_height"
|
||||
android:layout_height="@dimen/conversation_compose_height"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:background="@drawable/circle_tintable"
|
||||
|
@@ -1,9 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:title="@string/conversation__menu_add_attachment"
|
||||
android:id="@+id/menu_add_attachment" />
|
||||
|
||||
<item android:title="@string/conversation__menu_view_all_media"
|
||||
android:id="@+id/menu_view_media" />
|
||||
|
||||
|
@@ -30,6 +30,7 @@
|
||||
<attr name="conversation_editor_background" format="reference|color"/>
|
||||
<attr name="conversation_editor_text_color" format="reference|color"/>
|
||||
<attr name="conversation_input_background" format="reference"/>
|
||||
<attr name="conversation_input_inline_attach_icon_tint" format="reference"/>
|
||||
<attr name="conversation_transport_sms_indicator" format="reference"/>
|
||||
<attr name="conversation_transport_push_indicator" format="reference"/>
|
||||
<attr name="conversation_transport_popup_background" format="reference"/>
|
||||
|
@@ -34,6 +34,7 @@
|
||||
<dimen name="media_bubble_min_height">100dp</dimen>
|
||||
<dimen name="media_bubble_max_height">320dp</dimen>
|
||||
|
||||
<dimen name="conversation_compose_height">40dp</dimen>
|
||||
<dimen name="conversation_individual_right_gutter">16dp</dimen>
|
||||
<dimen name="conversation_individual_left_gutter">16dp</dimen>
|
||||
<dimen name="conversation_group_left_gutter">52dp</dimen>
|
||||
|
@@ -148,6 +148,7 @@
|
||||
<item name="conversation_editor_background">#22000000</item>
|
||||
<item name="conversation_editor_text_color">#ff111111</item>
|
||||
<item name="conversation_input_background">@drawable/compose_background_light</item>
|
||||
<item name="conversation_input_inline_attach_icon_tint">@color/core_light_60</item>
|
||||
<item name="conversation_transport_sms_indicator">@drawable/ic_send_sms_insecure</item>
|
||||
<item name="conversation_transport_push_indicator">@drawable/ic_send_push</item>
|
||||
<item name="conversation_transport_popup_background">@color/white</item>
|
||||
@@ -321,6 +322,7 @@
|
||||
<item name="conversation_editor_background">#22ffffff</item>
|
||||
<item name="conversation_editor_text_color">#ffeeeeee</item>
|
||||
<item name="conversation_input_background">@drawable/compose_background_dark</item>
|
||||
<item name="conversation_input_inline_attach_icon_tint">@color/core_dark_05</item>
|
||||
<item name="conversation_transport_sms_indicator">@drawable/ic_send_sms_insecure_dark</item>
|
||||
<item name="conversation_transport_push_indicator">@drawable/ic_send_push</item>
|
||||
<item name="conversation_transport_popup_background">@color/black</item>
|
||||
|
Reference in New Issue
Block a user