This is what I want:

This is what I have done:

The difference is there are some spaces between the lines and the border because I used padding=10dp for outer border:
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF"/>
<stroke android:width="2dp" android:color="#808080"/>
<corners
android:radius="10dp"/>
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp"/>
</shape>
Am I doing this right? How can I fix this problem?
Here is the xml file as you want .
Remove Padding from your xml file and put padding in each widget. Here test.xml is your background xml file witout padding attribute.
Edit test.xml file