I want to display progressbar(spinner) to the right of editText when activity is doing some processing and hide upon completion, is there a simple way to do this?
I'd use RelativeLayout
, something like this:
<RelativeLayout>
<EditText
android:id="@+id/the_id"/>
<ProgressBar
style="?android:attr/progressBarStyleSmall"
android:layout_alignTop="@id/the_id"
android:layout_alignBottom="@id/the_id"
android:layout_alignRight="@id/the_id"/>
</RelativeLayout>
Try this...
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:ems="10"
android:hint="@string/app_name"
android:inputType="textNoSuggestions"
android:padding="8dp" >
</EditText>
<ProgressBar
style="?android:attr/progressBarStyleInverse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/editText"
android:layout_alignRight="@id/editText"
android:layout_alignTop="@id/editText" />
</RelativeLayout>
</LinearLayout>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With