Compose: auto-complete mentions, hashtags, and emojis

This commit is contained in:
Grishka
2022-03-17 06:28:36 +03:00
parent 098128bcd4
commit 7186b6387f
12 changed files with 863 additions and 19 deletions

View File

@@ -82,19 +82,27 @@
</RelativeLayout>
<EditText
android:id="@+id/toot_text"
<FrameLayout
android:id="@+id/toot_text_wrap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingBottom="16dp"
android:textAppearance="@style/m3_body_large"
android:gravity="top"
android:background="@null"
android:hint="@string/compose_hint"
android:inputType="textMultiLine|textCapSentences"/>
android:layout_marginTop="10dp">
<org.joinmastodon.android.ui.views.SelectionListenerEditText
android:id="@+id/toot_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingBottom="16dp"
android:textAppearance="@style/m3_body_large"
android:gravity="top"
android:background="@null"
android:hint="@string/compose_hint"
android:elevation="0dp"
android:inputType="textMultiLine|textCapSentences"/>
</FrameLayout>
<LinearLayout
android:id="@+id/poll_wrap"

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<ImageView
android:id="@+id/photo"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="12dp"
tools:src="#0f0"/>
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/photo"
android:textAppearance="@style/m3_title_medium"
android:fontFamily="sans-serif"
android:singleLine="true"
android:ellipsize="end"
tools:text="User Name"/>
<TextView
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/photo"
android:layout_alignBottom="@id/photo"
android:textAppearance="@style/m3_body_medium"
android:textColor="?android:textColorSecondary"
android:singleLine="true"
android:ellipsize="end"
tools:text="\@user@domain"/>
</RelativeLayout>