TextViewとImageViewを含むRelativeLayoutを使用して独自のボタンを作成できます。ログインメソッドが呼び出されているもので
<RelativeLayout android:id="@+id/login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
onClick="[yourLoginMethod]" >
<TextView android:id="@+id/login_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="Log In" />
<ImageView android:id="@+id/login_loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/login_text"
android:visibility="gone" />
</RelativeLayout>
そして、のTextViewの内容を変更、それは親の権利を合わせ、目に見えるにImageViewの可視性を設定してください。
loginText.setText("Logging In...");
LayoutParams params = loginText.getLayoutParams();
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
loginText.setLayoutParams(params);
loginLoading.setVisibility(View.VISIBLE);
また、ログインが失敗した場合にこれらの変更を元に戻すコードもあります。ここで