S
S
sfilmak2017-09-15 00:03:26
Android
sfilmak, 2017-09-15 00:03:26

How to make EditText like in Instagram?

Hey!
I want to add an EditText to my app that should look exactly like the EditText in Instagram Stories:
11f1ce7dce5742378b748c8ef20fc028.jpg
The main problem is how to make the background fit the text.
Here is my EditText:

<EditText
            android:id="@+id/editText"
            style="@style/Widget.AppCompat.EditText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:layout_weight="1"
            android:background="@drawable/edittext"
            android:hint="Sample writingSample writingSample writingSample writing"
            android:inputType="textCapSentences|textMultiLine"
            android:padding="10dp"
            android:selectAllOnFocus="true"
            android:singleLine="false"
            android:textAlignment="center"
            android:textColor="#ffffff"
            android:textSize="35sp" />

And the background of the EditText itself:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="rectangle">
            <solid android:color="#40ffffff"/>
            <corners android:radius="5dp" />
            <stroke
                android:width="2dp"
                android:color="#40ffffff"
                />
        </shape>
    </item>
</selector>

Thank you very much in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mitaichik, 2017-09-15
@mitaichik

I just don't think it can be done. Why not decompile instagram and see how they did it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question